Important MCQ

Output of cout << 10 % 4; is

Q.Output of cout << 10 % 4; is

A) 4
B) 2
C) 0
D) 2.5
Correct Answer:
Option B
Detailed Explanation:
B) 2 is correct. Apply the relevant C++ rules: integer versus floating-point division, remainder, operator precedence, loop execution, ternary selection, data types, and the syntax of main().