help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

help!

hello brothers! please tell me once, if i write like this """"if(10<x>15) {cout<<yes;}""""" it's correct? but it's not worked? how i must write it?

12th Oct 2016, 2:24 AM
sirojiddin
3 Answers
+ 6
Assuming you mean if x is less than 10 or more than 15: if (x<10 || x>15) { cout<<"yes"; } || is the OR operator, meaning if either condition is true the statement will be executed.
12th Oct 2016, 2:43 AM
Liam
Liam - avatar
+ 5
Liam is right, but I suppose you probably mean "x between 10 and 15" In this case it's (x>10 && x<15)
12th Oct 2016, 6:59 AM
marcram
0
thanks brother!
12th Oct 2016, 7:37 AM
sirojiddin