View Single Post
  #1  
Old 01-03-2011, 02:28 PM
bonfire's Avatar
bonfire bonfire is offline
M.Arsalan Qureshi

 
Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to enter an integer and print if it is greater or less than 100

Program to enter an integer and print if it is greater or less than 100

#include <iostream.h>
#include <conio.h>

void main(){
clrscr();
int x;
cout << "Enter an integer : " << endl;
cin>>x;
if(x>100)
{
cout << x << " is greater than 100." << endl;
}
else
{
cout << x << " is less than 100." << endl;
}
getch();
}
This program takes in an integer x as a screen input from the user.
The program tells the user whether that integer is greater than 100 or less than 100.
It then prints out the appropriate message using the 'cout' command.

Sample Input
74
Sample Output
74 is less than 100.

__________________

Reply With Quote