Input and Output in C Language
STANDARD INPUT AND OUTPUT
printf()
Example
#include <stdio.h>
Main()
{
printf(" C Language");
};
Output : C Language
scanf()
EXAMPLE--
#include <stdio.h>
int main()
{
int test;
printf("enter an integer ");
scanf("%d", & test);
prinft(" number = %d", test);
return 0;
}
Output
Enter an integer 5
Number = 5
The scanf() function reads formatted input from the keyboard. When user enters an integer, it is stored in variable test. Note the '&' sign before test; gets the address of test and the value is stored in that address.
Comments
Post a Comment