Define and explain scanf () function?

Scanf() is a predefined function in standard input/output (stdio.h) header file. This function can be used to read the value from the keyboard.

Ex: int x;
int y;
scanf("%d%f", &x,&y); ----> this example is used to specify the datatype of a value in C programming language.
 
In the C programming language, scanf is a function that reads formatted data from stdin (i.e, the standard input stream, which is usually the keyboard, unless redirected) and then writes the results into the arguments given.
 
Back
Top