Multiple choice

Which of the following operators is used for modulus or remainder?

  1. /

  2. //

  3. %

  4. %%

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The modulus operator % returns the remainder after division of one number by another. For example, 10 % 3 = 1 because 10 divided by 3 is 3 with remainder 1. Option C correctly identifies % as the modulus operator. The / operator performs division, // is not a standard C++ operator (it's used in Python for floor division), and %% has no special meaning in C++.