Formatted Functions
The formatted functions used in C programming are printf and scanf functions.
Printf prints the formatted output on screen as specified in format specifier.This function can also be used for displaying all the datatype variables.
e.g.
printf(char,var1,var2,....);
This function is used to enter the data.
The scanf function accepts the formatted input from user as specified in format specifier & in variable address given as parameter.
e.g.
scanf("%d",&char);
Example:
main()
{
int x;
char A;
printf("\nx=%d",x);
printf("\nx=%c",ch);
printf("\nPress any key to continue");
getch();
}
In the program above \n is the new line character.
The formatted functions used in C programming are printf and scanf functions.
Printf prints the formatted output on screen as specified in format specifier.This function can also be used for displaying all the datatype variables.
e.g.
printf(char,var1,var2,....);
This function is used to enter the data.
The scanf function accepts the formatted input from user as specified in format specifier & in variable address given as parameter.
e.g.
scanf("%d",&char);
Example:
main()
{
int x;
char A;
printf("\nx=%d",x);
printf("\nx=%c",ch);
printf("\nPress any key to continue");
getch();
}
In the program above \n is the new line character.
Comments