Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Conditions

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){}

?

Name: Anonymous 2011-09-03 10:46

What >>2 said, but it's a good idea to put them in separate brackets, for the sake of readability.
if((x > 0) && (x < 10) {
  shit;
}

It evaluates to the exact same thing, since < and > operators have higher priority than && operator, but it looks nicer.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List