In my if statement I want the values to be in a range say 70 - 80 for the condition to be true. I cannot seem to get it to work and am not sure if it is possible, any comment on how can I go about this.
Thanks in advance
In my if statement I want the values to be in a range say 70 - 80 for the condition to be true. I cannot seem to get it to work and am not sure if it is possible, any comment on how can I go about this.
Thanks in advance
Is this what you want?Code:if(x>70 && x<80) { }
abh!shek gave code for the exclusive set. Here's the code for the inclusive set:Code:if(x>=70 && x<=80) { }
That means, x MUST be greater than 70 AND less than 80.
As you know, && = boolean and