I know this is a very simple problem but I cant figure it out. I have been doing the tutorials and trying to learn but I got stuck on the IF... I know, kind of sad.
This is my code:
Everything works except if age equals 15 or 14. If age equals 15 or 14 it still executes if ( age < 50 ) {....Code:#include <iostream>
using namespace std;
int main()
{
int age;
cout<<"How old are you? ";
cin>> age;
cin.ignore();
if ( age < 50 ) {
cout<<"You are under 50! I know, I'm amazing!\n";
}
else if ( age == 14 || 15) {
cout<<"Blah/n";
}
else if ( age == 100 ) {
cout<<"You're older than my grandmother!\n";
}
else {
cout<<"You're really old\n";
}
cin.get();
}
Can you tell me whats wrong. Please.
-Thx