A children's game of 'count out' is played as followed. '40' children are arranged in a circle, a sentence containing of 'm' words is used to eliminate '1' child at a time until '1' child is left. Starting at child '1' the children are counted from '1' to 'm' and the 'm' th child is eliminates. Starting with the child after the one just eliminated the children are then counted from '1' to 'm' and the 'm'th child is eliminated. This is repeated until one child is left. Counting is done circularly and eliminated children are not counted. Write a program to read a value for m and print the number of the last remaining child.
Sarah_23
0
Newbie Poster
Recommended Answers
Jump to PostYou'll have to show your work and code then explain what's stopping you.
Read https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question
All 2 Replies
rproffitt
2,580
"Nothing to see here."
Moderator
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.