Consider the following if statement, which is syntactically correct, but uses poor
style and indentation:
if (x >= y) if (y > 0) x = x * y; else if (y < 4) x = x - y;
Assume that x and y are int variables containing the values 9 and 3, respectively,
before execution of the preceding statement. After execution of the statement, what
value does x contain?
a. 9
b. 1
c. 6
d. 27
e. none of the above
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.