In this program we would be taking input from user and printing the same on the 
 screen by using scanf function as its name specifies it scans the value entered by user or 
it enables the program to ask for the input from user and store it in a specific variable 
which is n in this program by providing address through & (ampersand) sign. And to 
re mention that value we use format specifiers like  one we have used in the program  
(%d - for integer values)..

Program

#include<stdio.h>

int main()

{

  int n;

  printf("Enter the number= ");

  scanf("%d",&n);

  printf("Entered number is = %d",n);

  return 0;

}

Output :



value initialised for n is 6 and so the number is pinted..

                           << Back

Post a Comment

Previous Post Next Post