What is modulus and how does it work in C++? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

What is modulus and how does it work in C++?

What is modulus and how does it work in C++? How to calculate it and what is the utility?

2nd Dec 2017, 4:25 AM
Arielle
Arielle - avatar
2 Réponses
+ 5
Modulus operator is not limited to C++ only. But here is how it works: You know that 27=6*4+3 Hence, 3 the remainder when 27 is divided by 6. Hence, 27%6=3.
2nd Dec 2017, 4:41 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
This code will help you to fully understed how modulus works: https://code.sololearn.com/Wcy7iV5Ln1ly/?ref=app
16th Dec 2017, 3:55 PM
Elazar Feinstein
Elazar Feinstein - avatar