0 votes
in C Plus Plus by
What is the use of printf() and scanf() functions in C Programming language?

1 Answer

0 votes
by

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.

Related questions

0 votes
asked Jan 7 in C Plus Plus by GeorgeBell
0 votes
asked Jan 9 in C Plus Plus by GeorgeBell
...