Tuesday, 14 January 2014

Explain Input and Output function in C

I/O function

Input function-A program takes data through input function.
Output function-A program displays result on screen through output function

2 Types

a)  Formatted b) Unformatted function

Formatted function-It read and write all types of data types.

2 Types

a) printf( ) b) scanf( )

printf() statement-It prints data values to the console.It need conversion symbols to print  variable values.Here escape sequence \n is used for new line.

scanf() statement-It reads data values.It need conversion symbols to read variable values.
The '&' address operator is used to indicate memory location of variable,so that value read should be placed in that location.

Unformatted function-It work with only character data type.
(a) getchar( ) (b) putchar( ) (c) getch( ) (d) getche ( ) (e) gets( ) (f) puts( )

No comments:

Post a Comment