0
How we can add two condition in one if function
4 Réponses
+ 2
I believe you are thinking of the and statement which is represented in c++ by the "&&"
If (firstCondition && secondCondition){
/*something will happen if both conditions are met*/
}
+ 2
Use logical operators:
if((x>=3)&&(x<=8)) for example is true then x greater or equals 3 and less or equals 8
+ 1
Well, you can always use &&. I'm not sure what you're asking here, though :)
+ 1
You can use && if you want the two condition corect, or use || if you want either of the two condition is correct, :)