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.
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 contribute.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.
- Maximize count of equal numbers in Array of numbers upto N by replacing pairs with their sum
- Check if count of Alphabets and count of Numbers are equal in the given String
- Python program to count Even and Odd numbers in a List
- Python program to count positive and negative numbers in a list
- C program to count Positive and Negative numbers in an Array
- Maximum sum of distinct numbers such that LCM of these numbers is N
- Find ratio of zeroes, positive numbers and negative numbers in the Array
- Count numbers that don't contain 3
- Count numbers with unit digit k in given range
- Count Odd and Even numbers in a range from L to R
- Count of Octal numbers upto N digits
- Count of numbers upto M with GCD equals to K when paired with M
- Count of numbers with all digits same in a given range
- Count of ways to write N as a sum of three numbers
- Count of decreasing pairs formed from numbers 1 to N
- Count of numbers in Array ending with digits of number N
- Count of Missing Numbers in a sorted array
- Count all N digit numbers whose digits are multiple of X
- Program to print a pattern of numbers
- C Program to Swap two Numbers