If statement

Im making a test with if-statement. And if i want to make the (if) between two numbers? how do i do that?

for example...

if (age == 13-17){
cout <<"your a teenager";
}

And i need help with the "13-17". Please reply if you know the anwser :)

Hello,

How about checking if the number is greater than 13 and less than 17?

if age > 13 and age < 17

Jimbot
using && instead of and, may also help improve the readability!
1
2
3
4
if(age>=13&&age<=17)
{
         cout <<"your a teenager";
}


how about that?
Thanks! it really helped :D
This is driving me nuts..."you're".
Topic archived. No new replies allowed.