Program to Count numbers on fingers
Count the given numbers on your fingers and find the correct finger on which the number ends.
- The first number starts from the thumb, second on the index finger, third on the middle finger, fourth on the ring finger, and fifth on the little finger.
- Again six comes on the ring finger and so on.
- Here we observer a pattern, 8(last number) and 2 ends up in 2nd position, 3rd or 7th on the middle finger, and so on.
- The pattern keeps repeating after every 8 numbers
- 1 to 8
- 9 to 16
- 17 to 24, and so on
Input : 17 Output :1 Input :27 Output :3
Asked in Paytm Campus Placement August 2017
This article is contributed by Dinesh Malav. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Participate in the Scholorship Test for First-Step-to-DSA Course for Class 9 to 12 students.