1.

For what values of the expression is an if-statement block not executed?(a) 0 and all negative values(b) 0 and -1(c) 0(d) 0, all negative values, all positive values except 1I have been asked this question at a job interview.My enquiry is from Booleans topic in chapter Types, Pointers, Arrays & Structures in C++ of C++

Answer» CORRECT choice is (c) 0

Best explanation: The if-statement BLOCK is only not executed when the expression evaluates to 0. its just SYNTACTIC sugar for a branch-if-zero INSTRUCTION.


Discussion

No Comment Found

Related InterviewSolutions