Q. What will be the output of the following code?
int a = 10, b = 3;
cout << a % b;
int a = 10, b = 3;
cout << a % b;
β
Correct Answer: (A)
1
Explanation: The modulus operator (%) returns the remainder of division. 10 % 3 results in 1.