There are N boys playing a game. They form a circle and have index from 1 to N clockwise. At the start, boy-1 is holding the ball. He says 1 and gives next person. next person says 2 and gives ball to next to next ie 2nd boy to him and so on. Games ends after N-1 passes. Print N-1 indexes showing index of boy holding the ball
Output Format:N-1 indexes showing index of boy holding the ball
Sample Output:2 4 7 11 5 11 7 4 2 1
Explanations:1+1=2,2+2=4,4+3=7,7+4=11,11+5=16-11=5 and so on
print "$c ";
Take care of condition when ball is with last person to reset counter to 1.