Given a number N, the task is to find the smallest Even number with N digits.
Input: N = 1 Output: 0 Input: N = 2 Output: 10
Case 1 : If N = 1 then answer will be 0.
Case 2 : if N != 1 then answer will be (10^(N-1)) because the series of smallest even numbers will go on like, 0, 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 integers in a range which have even number of odd digits and odd number of even digits
- Smallest odd number with even sum of digits from the given number N
- Number formed by deleting digits such that sum of the digits becomes even and the number odd
- Find smallest number with given number of digits and sum of digits under given constraints
- Smallest even digits number not less than N
- Check whether product of digits at even places is divisible by sum of digits at odd place of a number
- Even digits Sum and Odd digits sum divisible by 4 and 3 respectively
- Count numbers in given range such that sum of even digits is greater than sum of odd digits
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Minimum digits to be removed to make either all digits or alternating digits same
- Check if a number with even number of digits is palindrome or not
- Find the smallest number whose digits multiply to a given number n
- Smallest number by rearranging digits of a given number
- Immediate smallest number after re-arranging the digits of a given number
- Find smallest possible Number from a given large Number with same count of digits
- Find smallest number formed by inverting digits of given number N
- Find the Largest number with given number of digits and sum of digits
- Number of digits in the nth number made of given four digits
- Count ways to express even number ‘n’ as sum of even integers
- Average of even numbers till a given even 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.
Improved By : ihritik