printf() function is used to print the value which is passed as the parameter to it on the console screen.
Syntax:
print(“%X”,variable_of_X_type);
scanf() method, reads the values from the console as per the data type specified.
Syntax:
scanf(“%X”,&variable_of_X_type);
In C format specifiers are used to tell the compiler what type of data will be present in the variable during input using scanf() or output using print().
- %c: Character format specifier used to display and scan character.
- %d, %i: Signed Integer format specifier used to print or scan an integer value.
- %f, %e, or %E: Floating-point format specifiers are used for printing or scanning float values.
- %s: This format specifier is used for String printing.
- %p: This format specifier is used for Address Printing.