+ 1

What does % mean in C++

Someone explain pls

4th Oct 2018, 11:18 AM
PR1D3
2 Respuestas
+ 3
The % sign means the modulo operator. If you have the numbers 7 and 2 and you do 7%2, the result will be 1. Why? Because the modulo operator returns the remainder of the division. 7 / 2 = 3 remainder 1. So 7%2=1.
4th Oct 2018, 12:02 PM
Alexandru Turculet
Alexandru Turculet - avatar
+ 1
its modulo. if you went through the courses, you should know this.
4th Oct 2018, 12:08 PM
Kuyondo
Kuyondo - avatar