How do you say if (A == 0) OR (B == 0)
?
I wish I could accept multiple answers.
cf_PhillipSenn
2009-05-27 14:30:20
I've faced this dilemma before; what I did was give the best answer a checkmark (15pts) and the rest of them that were almost as good +1s.
Jason S
2009-05-27 14:38:46
I always give it to the guy with less points =)
Kieveli
2009-05-27 14:41:38
+10
A:
if (A == 0 || B == 0)
or
if ((A == 0) || (B == 0))
Check out Control Structures and Operators on Wikibooks
Boris Guéry
2009-05-27 14:25:14
Now all you have to do is change your name from "Coehoorn" to "Coercion" ;)
Eoin Campbell
2009-05-27 14:32:33
Nosredna
2009-05-27 14:45:25
+6
A:
depends if you mean exclusive or inclusive OR :)
Inclusive OR:
if(A == 0 || B == 0)
{
}
Exclusive OR:
if(A == 0 && B != 0 || A != 0 && B == 0)
{
}
Brian R. Bondy
2009-05-27 14:30:30