A

Admin • 828.03K Points
Coach

Q. What will be the output of the following code?

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

Explanation by: Admin
3 % 2 equals 1. The modulus operator returns the remainder.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.