A14: scanf() and
printf() are two commonly used functions for input and output operations. They
are part of the standard input/output library (stdio.h).
printf()
Function:
printf() is used for
formatted output in C. It allows us to display data on the screen.
Syntax
of printf(): printf(format_string, argument1, argument2,
...);
e.g. int age = 25;
printf("My age is %d years.\n", age);
Output:
My age is 25 years.
scanf()
Function:
scanf() is used for
formatted input in C. It allows us to read data from the standard input.
Syntax
of scanf(): scanf(format_string, &variable1,
&variable2, ...);
e.g. int age; printf("Enter
your age: "); scanf("%d", &age);