
&& or 
Hi
Is it possible for someone to explain to me when using the boolen expressions && and  when each one should be used I keep making the mistake of using && when it should be  or vice and versa.
So
if((answer > 5) && (answer <10))
or is it
if((answer > 5)  (answer <10))
thanks

Your first if statement evaluate as true if variable answer is a number between 5 and 10.
Second if statement is true for any numbe.
 is ismilar to union and && to intersection.
Check this (just for logic):
http://www.themathlab.com/geometry/s...tersection.htm
 Micko

Thanks for your prompt reply
I at least completely understand && now.
Okay I am going to act dum however, it's only way I will finally understand this,
Why would  be for any number?
Thank you

You have ( cond1  cond 2 ) as a single expression, which could be either true or false. What or (  ) does is to say, "the expression is true when at least one of cond1 or cond2 is true, and false otherwise." Or, you could say, "the expression is true if cond1 is true, cond2 is true, or both are true, and false otherwise."

Right I understand
Thanks :D