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;
}
β
Correct Answer: (A)
1
Explanation: 3 % 2 equals 1. The modulus operator returns the remainder.