What is the purpose of the modulus operator (%) in C++?
- Multiplication
- Addition
- Division
- Remainder Calculation
The modulus operator (%) in C++ is used to calculate the remainder of a division operation between two integers. It is especially useful when we need to determine if a number is divisible by another.
Loading...
Related Quiz
- A function that calls itself directly or indirectly is known as a _______ function.
- How does the short-circuit evaluation work in logical operators?
- The enum class introduces _______ scope to prevent enumerators from polluting the namespace.
- Which keyword is used to catch exceptions in C++?
- When performing a bitwise AND operation with a number and 0, the result is always _______.