Q. if originally x=4, y=0 and z=2, what are the values of x,y and z after executing the following code
if(z==0||x && !y)
if (!z)
y=1;
else
x=2;
Last edited on
if you write first if() this way, its easier to understand.
if ((z==0||x) && !y )
or,
if (z==0|| (x && !y ))
its true.
then, !z = !2 = 0 = false
so, the else works.
can you please tell me how to write a program on this question