Given a number N, find the remainder when the first digit of N is divided by its last digit.
Input: N = 1234 Output: 1 First digit = 1 Last digit = 4 Remainder = 1 % 4 = 1 Input: N = 5223 Output: 2 First digit = 5 Last digit = 3 Remainder = 5 % 3 = 2
Approach: Find the first digit and the last digit of the number. Find then the remainder when the first digit is divided by the last digit.
Below is the implementation of the above approach:
- Program to find remainder when large number is divided by 11
- Program to find remainder when large number is divided by r
- Count of Numbers in Range where first digit is equal to last digit of the number
- Largest number less than N with digit sum greater than the digit sum of N
- Largest number by which given 3 numbers should be divided such that they leaves same remainder
- Find the Number which contain the digit d
- Minimum number of operations on a binary string such that it gives 10^A as remainder when divided by 10^B
- Find nth number that contains the digit k or divisible by k.
- Find the frequency of a digit in a number
- Program to find last digit of n'th Fibonnaci Number
- Find minimum possible digit sum after adding a number d
- Find last five digits of a given five digit number raised to power five
- Generate a number such that the frequency of each digit is digit times the frequency in given number
- Count 'd' digit positive integers with 0 as a digit
- Check if frequency of each digit is less than the digit
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.