Which of the following statement is correct about the code snippet given below?
num = 5;
printf( "%d", ++num++ );
Answer: C
Correct answer: The code will result in L – value required
++num++ groups as ++(num++), because postfix binds tighter than prefix. The result of num++ is a value, not an object, so the prefix ++ has nothing it can modify - the compiler reports that an lvalue is required. The same applies to ++(a + b) or 5++.
Please log in or register to report this question.