+ 3

A 'modulo' in Java?

Can someone explain me what a modulo is in Java?

2nd Feb 2018, 9:02 AM
Mr. Cat
Mr. Cat - avatar
2 Réponses
+ 4
% is the modulo in Java. it gives the remainder of the division. e.g. 3%2 wil give 1
2nd Feb 2018, 9:23 AM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 2
% modulo divides to numbers and delivers the remainder : 5%2 = 1 10%2 = 0
2nd Feb 2018, 9:20 AM
Andreas K
Andreas K - avatar