What is the purpose for using a modulo operator in qoutient and reminder? How is it worked out? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the purpose for using a modulo operator in qoutient and reminder? How is it worked out?

1.25 % 0.5= 0.25

28th Feb 2017, 3:59 PM
Benstead Towara
Benstead Towara - avatar
2 Answers
+ 9
sometimes you might want to know if a certin variable is odd or even. You can use the modulo (%) operator then check value of remainder, remainder =0 Even other than =0 Odd
22nd Oct 2017, 5:40 AM
niteOwLTwO
niteOwLTwO - avatar
+ 5
modulo operator returns the remainder obtained as the result of a division operation. 1.25 = 2(0.5) + 0.25 meaning 2 is the quotient and 0.25 is the remainder.
28th Feb 2017, 4:06 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar