A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
#include <stdio.h>
int main() {
int x = 1;
if (x = 0)
printf("Zero");
else
printf("Not Zero");
return 0;
}
  • (A) Zero
  • (B) Not Zero
  • (C) Error
  • (D) Nothing
  • Correct Answer - Option(B)
  • Views: 28
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

x = 0 assigns 0, which is false, so 'Not Zero' is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.