+ 1
When we use modulus in c++
2 Antworten
+ 2
a good example of the use of modulus is to find all the even numbers in a loop. remember modulus returns the remainder not the division. e.g. 5%2=1
+ 2
Modulus returns the remainder of an integer. For example 5%3==2. There is also fmod() for floating point numbers.