Sunday, June 23, 2019

printf() and scanf() in C


The printf() and scanf() functions are used for input and output in C language. Both functions are inbuilt library functions, defined in stdio.h (header file).

printf() function
The printf() function is used for output. It prints the given statement to the console.

Printf(“Welcome To The Aryabhatta Institute”);
Printf(“format string”, argument_list);

The format string can be %d (integer), %c (character), %s (string), %f (float) etc.

scanf() function
The scanf() function is used for input. It reads the input data from the console.
scanf(“format string”, argument_list);

No comments:

Post a Comment