9. modulo operator


#1

modulo operator remainder ? whats this ill its want a remainder 2 so i types 10/5 this will give 2 but this exp is wrong !!!!


Stuck on question 9 modulo operator
#2

Modulo is different from division. Modulo gives just the remainder.

10 / 5 gives 2
10 % 5 gives 0


#3

how is there any formula for obtaining remainder ???


#4

I'm not really sure what you mean by that.

You can read the technical details of modulo here.


#5

i used 18 % 8; dont forget the ; or it wont go


#6

7 % 5 gives 2
10 % 5 gives 0


#7

A post was split to a new topic: 9. Why is 10/5 correct when it is division and not percentage (%)


#10

Thank you!!! That helped a lot. I just needed to add the ;


#11