3. The following statement is designed to check the relative sizes of three integers,which you may assume to be different from each other.
if (x<z) if (x<y) if (y<z) c=1; else c=2; else
if (y<z) c=3; else c=4; else if (x<y)
if (x<z) c=5; else c=6; else if (y<z) c=7; else
if (z<x) if(z<y) c=8; else c= 9; else c=10
The first line of code includes 3 if statements. How do you read this?
I cannot find any shorthand for if statements written this way. I believe it is read as:
if (x<z) if (x<y) if (y<z) c=1; else c=2; else
if (y<z) c=3; else c=4; else if (x<y)
if (x<z) c=5; else c=6; else if (y<z) c=7; else
if (z<x) if(z<y) c=8; else c= 9; else c=10
I think that the pseudo-code should be analysed with a stack. the if statement performs push and the else statement performs pop