Why does 24 % 7 = 4? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why does 24 % 7 = 4?

Why does 24 % 7 = 4? Is this because it rounds up?

19th May 2017, 9:41 AM
Corey
Corey - avatar
2 Answers
+ 12
% operator returns the remainder. As 24 = 7 * 3 + (3), the answer should be 3.
19th May 2017, 10:02 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
- 1
I think thats why, am i correct?
19th May 2017, 9:42 AM
Corey
Corey - avatar