Help with if statements

If I want to say something like

if this is true, and this is true, and this is true
than print this
else if this is true and this is true
print this.
How should i go about doing this?

if(queryPointCalc1 <= Circ1R) and (queryPointCalc2 <= Circ2R) and so fourth
cout<<"Circle Circ1 contains point "<<CircxQ,CircyQ;
Simple- for every and, replace with &&. Group the whole thing in one giant parenthesis in front of the if, and you have a functional double-check with short-circuit logic.
for every and, replace with &&
Ir not.
if ((queryPointCalc1 <= Circ1R) and (queryPointCalc2 <= Circ2R)) is perfectly valid C++

You might want to read tutorial on control:
http://www.cplusplus.com/doc/tutorial/control/
Last edited on
Topic archived. No new replies allowed.