C++ Programming : Program 6-A
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.
74
74 is less than 100.
|
45 more pages in C++ Programming