Input and Output in C Language

STANDARD INPUT AND OUTPUT






printf()






Example 


#include <stdio.h>
Main()
{
   printf(" C Language");
};

Output : C Language



scanf()


scanf() in c,what is scanf function in c



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

Popular posts from this blog

Important Announcements(download all my book free)

O LEVEL- INTERNET TECHNOLOGY & WEB DESIGN

Call by Reference with Pointer in C Language part-4-a