Page 10 - PROGRAMMING IN C_Neat
P. 10
10. Explain the unformatted input and output functions in detail. ***
Unformatted Input Functions:
getchar():
Used to read a character from the keyboard.
General Form:
variablename = getchar();
Example:
char a;
a = getchar();
gets():
Used to read a string from the keyboard.
General Form:
gets(variablename);
Example:
char a[10];
gets(a);
Unformatted Output Functions:
putchar():
Used to display a character on the monitor.
General Form:
putchar(variablename);
Example:
putchar(‘K’);
puts():
Used to display a string on the monitor.
General Form:
puts(variablename);
Example:
puts(“Kandan”);
_______________________________________________________________________________________