
Basic Input / Output Function used in 'C' Language
We know that the c language is accompanied by a collection of library functions, which includes a number of input/output functions.these functions allow the transfer of information between the computer and the input/output devices.
There are multiple input/output functions in 'C'. Main Two of them are as follows:-
Input function: -
Data (values) can be accepted in the program by means of some functions, which are already defined in the standard c library. The most common function is the scanf() function.
Scanf() function: -
Data can be entered into the running program from a input device(keyboard).The input will be be taken by the c library functions scanf(). This function can be used to take input in which is of type number (int,long,float or double), character, string or combination of both.
General syntax of scanf() function is as: -
scanf(“Format Specifier”,&veriable1, &variable,. . . ,&veriable_n);
Output function: -
Data can be outputted from the computer onto a output device known as monitor using function printf().
Printf() function :-
Printf() function can be used to display some text as output on the monitor.
General syntax of printf() function is as:-
printf(“message to be displayed”);
The message (output) which you want to display should be enclosed in double quotes. Printf() function will print the enclosed message on the screen.
If You like our Blog do subscribe
Comment down Below
Subscribe to our Channel -
Comments
Post a Comment