#include<iostream> //for input/output
#include<cmath> //for abs funtion
using namespace std;
int main()
{
int AgeYears; //declaring variable for age
cout << "Enter the age in years: "; //promting the user to enter age
cin >> AgeYears;
AgeYears = abs(AgeYears); //getting absolute variable
//appling different conditions and poducing different outputs
if( AgeYears <= 3 ) //for baby
cout << "\nYou are a Baby\n";
else if( AgeYears <= 7 ) //for toodler
cout << "\nYou are a Toodler\n";
else if( AgeYears <= 12 ) //for child
cout << "\nYou are a Child\n";
else if( AgeYears <= 19 ) //for teenager
cout << "\nYou are a Teenager\n";
else //for adult or old ager
cout << "\nYou are a Adult or and Old ager\n";
return 0;
}
No comments:
Post a Comment