Write a C++ program wheck whether a given number is greater than 18 or not
Answers
Answered by
26
#include <iostream>
using namespace std;
int main( )
{
int num;
cout<<"\n enter a number";
cin>>num;
if( num>=18)
{
cout<<"\n Number is greater than 18";
}
else
{
cout<<"\n number is not greater than 18";
}
}
\rm{enter \: a \: number = 21 \: number \: is \: greater \: than \: 18 \\ enter \: a \: number = 10 \: number \:is \: not \: greater \: than \: 18 }[/tex]
hope this helps..
Similar questions