Name: Anonymous 2011-09-03 10:01
Is it not possible to use
if(0<x<10){}
or do you have to use
if(x>0&&x<10){}
?
if(0<x<10){}
or do you have to use
if(x>0&&x<10){}
?
if((x > 0) && (x < 10) {
shit;
}if (0 < x < 10) is not identically equal to if (0 < x && x < 10), one will branch more often than the other and it is probably not what you want.
0 < x will evaluate to 0 or 1, so you get 1 < 10. This is assuming that the language converts true and false to 1 or 0.
if((x>0)+(x<10)==2) {}
if((x%2==0)+(x%3==0)+(x%5==0)==2){
printf("Number is divisible by 2 of 3 primes less than 7");
}