The input statement: -
Input is that statement which is used to give data to the variable in the program. For C language the main input statement is scanf ( ). It is used in the program will be as:
Scanf (“format specifier”, ampersand sign variable);
For example:
Scanf (“%d or %f or %c or %s”, &a);
%d format specifier is used for integer type data.
%f format specifier is used for real type data.
%c format specifier is used for character type data.
%s format specifier is used for string type data.
The symbol & (ampersand sign) is used with scanf ( ) function and it is used to show the address of data.
The output statement: -
The output statement is that statement is used to display the result on screen. For this purpose the function printf ( ) is used. We can use it
Printf (“Message”);
Printf (“format specifier”, variable);
Printf (“%d or %f or %w”, sum);
Posted by: Wasim Javed
No comments:
Post a Comment