Check age


#include<iostream.h>
#include<conio.h>

void main()
{
    int age;
    clrscr();

    cout<<"Enter age:";
    cin>>age;

    if (age < 0)
        cout<<"\n\nAge is incorrect. \nEnter correct age.";

    if (age == 0)
        cout<<"\n\nAge is incorrect. \nYou dont even exist.";

    if (age < 12)
        cout<<"\n\nHe/She is a child.";
    else if (age < 20)
        cout<<"\n\nHe/She is a teanager.";
    else if (age < 40)
        cout<<"\n\nHe/She is a responsible citizen.";
    else if (age < 75)
        cout<<"\n\nHe/She is senior citizen.";
    else
        cout<<"\n\nHe/She is ready to leave Earth";
}
Previous Post Next Post