Make a program that will input age,
Check… age<=20 Display “Young”
Age>=21 Display “Adult”
Your program will be terminated if you input zero in age.
#include<iostream> using namespace std; int main(){ int age; cout<<"Enter your age:"<<endl; cin>>age; cout<<"Entered age is:"<<age<<endl; if(20>=age & age!=0){ cout<<"Young"<<endl; }else{ if(age>=21){ cout<<"Adult"<<endl; } } return 0; }
Output:
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments