PDA

View Full Version : Multiple conditions in while loop



NDK
02-04-2009, 10:14 AM
edit: i've made a mistake, i don't need a loop like this. But if i need one, is it correct to use an extra () like this ?


...
while((a<1||a>10)&&b==0){
...
}
...

codeexploiter
02-04-2009, 11:43 AM
This is correct.

Twey
02-04-2009, 06:50 PM
Yes, but I suggest adding in spaces for readability purposes. That kind of looks like line noise.