I/O function in C

I/O, Input Output, I/O in C

I/O function used read the input from the keyword and display the output to the screen. C Language have some predefined input and output function and that are listed below

I/O Functions for Single Character:-


  • It get only one character input and display one character only.

INPUT FUNCTION

getchar( )

getc( )

getch( )
OUTPUT FUNCTION

putchar( )

putc( )

putch( )

I/O Functions for String :-


  • It get multiple charter like a string can get as Input and also display by strings.

OUTPUT FUNCTION

puts( )
INPUT FUNCTION

gets( )

Scanf Input functions:-

Scanf( ) is a library function that is used for input function.  It return value is based on the either input value is correct or not.

Syntax:-

scanf ("Control Strings", &variable name);

Ex:

int a; float b,c;
scanf("%d",&a);
scanf("%f %f", &b,&c);

Printf Output Function:-

printf ( ) is a library function that displays information on screen. It return value is based on the characters of within the brackets and empty space also counted.

Syntax:-

printf ( "Control String", Variable name);

Ex:

int a; float b,c;
printf("%d", a);
printf("%f %f",b,c);

Printf and scanf functions most often Input output (I/O) functions. Both printf and scanf function has return values not null. We cannot define program without I/O.



Next
This is the most recent post.
Previous
Older Post

Post a Comment

Blogger