Question about boolean expression..
Posted on 2005-04-26
I am studying c++ and I am trying to figure out a question for a practice exam. It goes as follows:
Assume you have three int variables x =2, y=6 and z. Choose the value of z in the following:
z = (y/z>0) ? x : y;
am I correct in stating z=3 because the "?" is basically stating "if the previous expression is true (y/z > 0) then z =x, if it is false then y = z ? I am just making sure I am clear on what this expression is saying...
Thank you for your help...