Inpu-output functions(Formatted)
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.
Inpu-Output functions(Unformatted)
The C environment assumes that the standard input device(keyboard) and the standard output device(Monitor) are always connected to the C environment. Here's a list of some unformatted functions used in C along with their uses.
Input / Output Functions
Unformatted functions
getch()
Waits for user to press any key, returns the key pressed that can be assigned to variable like getch() but echoes character pressed to screen Accepts one character from user, terminates only when user presses enter. Even if user typed more than one character return first one character only. can pass character type parameter, a single character that you want to appear on screen. By passing character array as parameter can. accept string input including spaces. By passing character array as parameter can display the content of string
getche()
getchar()
putchar()
gets()
puts()