Given a number num in base N, check whether it is even or odd.
Input: num = 10, N = 8 Output: Even Explanation: 108 = 810, which is even Input: num = 122, N = 5 Output: Odd Explanation: 1225 = 3710, which is odd
- Convert the number num from Base N to Decimal base.
- Check whether the number is Odd or Even. This can be easily checked by dividing it with 2, and checking it’s remainder.
Below is the implementation of the above approach.
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.
- Given a number N in decimal base, find number of its digits in any base (base b)
- Check if a number has an odd count of odd divisors and even count of even divisors
- Check if the number is even or odd whose digits and base (radix) is given
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Find the Nth digit from right in base B of the given number in Decimal base
- Given a number N in decimal base, find the sum of digits in any base B
- Largest Even and Odd N-digit numbers of base B
- C++ program to find all numbers less than n, which are palindromic in base 10 and base 2.
- Add two integers of different base and represent sum in smaller base of the two
- Check whether a given number is even or odd
- Check whether given floating point number is even or odd
- Check whether product of digits at even places is divisible by sum of digits at odd place of a number
- Check if product of digits of a number at even and odd places is equal
- Check if a HexaDecimal number is Even or Odd
- Check if an Octal number is Even or Odd
- Check whether count of odd and even factors of a number are equal
- Check if a given number can be represented in given a no. of digits in any base
- Check if a number N starts with 1 in b-base
- Check if a number is power of k using base changing method
- Check whether a number has consecutive 0's in the given base or not
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.