You are on page 1of 2

Write a program that takes the user’s age as input and then finds out whether

the user is younger than a teenager, a teenager or older than a teenager.

Sol:

#include <iostream>

using namespace std;

int main()

int age;

cout<<"Enter Your Age: ";

cin>>age;

if (age<1)

cout<<"You input a wrong Age";

else if (age>=1 && age<13)

cout<<"You are Younger than a Teenager";

else if (age>=13&&age<=18)

cout<<"You are Teenager";

else if (age>18)

cout<<"You are Older than a Teenager";

cout<<"\n";
}

You might also like