Raj kanthrm

Greenhorn
+ Follow
since May 11, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raj kanthrm

Actually % symbol returns the remainder value. That is, if you put 5%2 means it will return 1. Because the quotient is 2 here and the remainder is 1.
Same way, if you put 2%5 means, you will get 2 as the answer. Because here the quotient is 0 & the remainder is 2. So your (i+1)%MAX_VALUE always return i+1 upto i=38. When i=39, the expression (i+1)%MAX_VALUE becomes (39+1)%40 which is equal to 0. Also when i=40, the result is 41%40=1

Thank you
13 years ago