Pages

How to enter integer value

//How to enter integer value.


#include<stdio.h>
#include<conio.h>

void main()
{
  int a; //declare a integer varaiable
  clrscr(); //clear the screen
  printf("Enter the value of an integer:"); //Show the message to user
  scanf("%d",&a); //Store the value entered by user in variable a.
  printf("You entered: %d",a); //Show the value of a
  getch(); //Hold the screen for output
}

Output:

Enter the value of an integer:25
You entered:25

No comments:

Post a Comment