Given an integer N, the task is to find the largest even and odd N-digit numbers in Hexadecimal Number System.
Input: N = 1
Input: N = 2
Approach: To get the largest number, the digits of the number have to be maximum possible. Since in the hexadecimal number system, the maximum digit is ‘F’. So, generate ‘F’ (N – 1) times and then append ‘E’ for even and ‘F’ for odd in the end.
Below is the implementation of the above approach:
Even: FE Odd: FF
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Largest and Smallest N-digit Hexadecimal Numbers
- Largest Even and Odd N-digit numbers in Octal Number System
- Check the divisibility of Hexadecimal numbers
- Largest number in [2, 3, .. n] which is co-prime with numbers in [2, 3, .. m]
- C program to Find the Largest Number Among Three Numbers
- Largest N digit number divisible by given three numbers
- Ternary number system or Base 3 numbers
- Find the count of natural Hexadecimal numbers of size N
- Largest number by which given 3 numbers should be divided such that they leaves same remainder
- Count Hexadecimal Number
- Check if a HexaDecimal number is Even or Odd
- Convert a binary number to hexadecimal number
- Reverse bytes of a Hexadecimal Number
- Program to Convert Hexadecimal Number to Binary
- Convert the number from International system to Indian system
- Convert the number from Indian system to International system
- Largest Even and Odd N-digit numbers
- Smallest and Largest sum of two n-digit numbers
- Largest Even and Odd N-digit numbers of base B
- Largest palindrome which is product of two N-digit numbers : Set 2
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.