0% found this document useful (0 votes)
52 views2 pages

Input

The document discusses input-output functions in C programming. It describes formatted functions like printf and scanf which allow printing and entering formatted data respectively using format specifiers. It provides an example of using printf and scanf. The document also lists some common unformatted input/output functions like getch(), getche(), getchar(), putchar(), gets(), and puts() and briefly describes their uses such as waiting for a key press, accepting single character input, displaying characters, and accepting/displaying string inputs.

Uploaded by

Innocent Harry
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Input

The document discusses input-output functions in C programming. It describes formatted functions like printf and scanf which allow printing and entering formatted data respectively using format specifiers. It provides an example of using printf and scanf. The document also lists some common unformatted input/output functions like getch(), getche(), getchar(), putchar(), gets(), and puts() and briefly describes their uses such as waiting for a key press, accepting single character input, displaying characters, and accepting/displaying string inputs.

Uploaded by

Innocent Harry
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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()

You might also like