Write simple program using if-else statement
#include <iostream>
using namespace std;
int main()
{
int age;
cout<<"\nEnter your age: ";
cin>>age;
if (age>18){
cout<<"\nYou are an adult.";
}
else{
cout<<"\nYou are still a child.";
}
return 0;
}
Comments
Leave a comment