A

Admin • 833K Points
Coach

Q. What does the following code do?

Code:
#include <stdio.h>
int main() {
int a = 1, b = 2;
printf("%d", a && b);
return 0;
}
  • (A) 1
  • (B) 2
  • (C) 0
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 20
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

a && b evaluates to true (1) since both are non-zero.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.