I have a question on a very basic operation of modulo operator.
Why does 1 % 9 produce 1? If 10 % 9 then remainder is 1.

I am very poor in math but have had to use modulo operator
many times before but always become confused and couldn't
understand the logic when dividend is smaller than divisor.

Thank you.

Recommended Answers

Well 9 divides into 1 zero times with 1 left over.

Jump to Post

All 2 Replies

Well 9 divides into 1 zero times with 1 left over.

Well 9 divides into 1 zero times with 1 left over.

I got the point.
Thank you very much for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.