cout << "Please input your age: \n";
cout << "Remember you can not enter 20 or 40 if you do it wont work sorry " << endl;
cout << "enter your age: \n";
cin >> age;
cout << "enter your name: " << endl;
cin >> em;
if (age<20){
cout << "you are just the right age " << em << endl;
}
else
{
if (age>40)
cout << "Your getting older " << em << endl;
}
So, do you have a question or problem, with your program? One problem I see, is the title. Actually, it won't work with any input from 20 TO 40, not 20 OR 40.