Search



Saturday, 7 February 2015

Input and Print

In this program, # is a preprocessor directive ,  whereas #include is used to extract the 
functions already created in files (eg:- conio.h contains getch() function). int x statement
declares variable named as x.
Line printf prints the whole statement written inside it. scanf() statement is used to take
input from user 7 store it in x (variable to store value).
printf () statement again prints the variable (%d is used to display int type variable) . 
getch() is used for input of any character.
For more information & explanation of this program click here..  



Program to input number and print.

#include<stdio.h>
#include<conio.h>
void main()
{       int a;
clrscr();
printf("program to input a no. & display it : ");
printf("\n\n enter value of a : ");
scanf("%d",&a);
printf("value of no. entered = %d",a);
getch();
}




No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.