Tuesday 7 July 2020

If Else Statement In C++

If Else Statement In C++

Code:
#include <iostream>
using namespace std;
int main()
{

int age;
cout<<" Enter Your Age"<<endl;
cin>>age;
if(age<18){

cout<<" You are Less Than 18"<<endl;
}
else if(age==18){
cout<<" You are 18"<<endl;

}
else{
cout<<" You are 18+"<<endl;

}

return 0;

}

No comments:

Post a Comment