A

Admin • 833K Points
Coach

Q. What is the output of this code?

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

Explanation by: Admin

0 is treated as false in C conditions, so 'False' is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.