Q. What is the output of the following code?
Code:int a = 10;
if (a = 0)
printf("Zero");
else
printf("Non-zero");
β
Correct Answer: (B)
Non-zero
Explanation: The assignment 'a = 0' evaluates to false, so the else block runs and prints 'Non-zero'.