Tuesday, July 19, 2011

A C language program that takes input from user

C Program:-


#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int num;
printf("Enter the value of num=");
scanf("%d",&num);       //this statement is used to get input and its format is scanf("format specifier",&variable name);
printf("\n The value of num = %d ",num);  
getch();
}


Output:-
                   Enter the value of num = 13
                   The value of num = 13

No comments:

Post a Comment