Given an integer N ≥ 1, the task is to find the smallest N digit number which is a multiple of 5.
Input: N = 1
Input: N = 2
Input: N = 3
- If N = 1 then the answer will be 5.
- If N > 1 then the answer will be (10(N – 1)) because the series of smallest multiple of 5 will go on like 10, 100, 1000, 10000, 100000, …
Below is the implementation of the above approach:
Time Complexity: O(1)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Count of N-digit numbers having digit XOR as single digit
- Smallest integer with digit sum M and multiple of N
- Smallest N digit number which is a perfect fourth power
- Smallest multiple of 3 which consists of three given non-zero digits
- Nth number whose sum of digit is multiple of 10
- Find Nth number in a sequence which is not a multiple of a given number
- Largest number less than N with digit sum greater than the digit sum of N
- Find the remainder when First digit of a number is divided by its Last digit
- Last digit of a number raised to last digit of N factorial
- Min steps to convert N-digit prime number into another by replacing a digit in each step
- Count of Numbers in Range where first digit is equal to last digit of the number
- Smallest multiple of N with exactly N digits in its Binary number representation
- Find the largest N digit multiple of N
- Count all N digit numbers whose digits are multiple of X
- Smallest K digit number divisible by X
- C++ Program for Smallest K digit number divisible by X
- Java Program for Smallest K digit number divisible by X
- Smallest n digit number divisible by given three numbers
- Check if the first and last digit of the smallest number forms a prime
- Largest and smallest digit of a number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.