Given an integer N, the task is to check whether the product of digits at even and odd places of a number are equal. If they are equal, print Yes otherwise print No.
Input: N = 2841
Product of digits at odd places = 2 * 4 = 8
Product of digits at even places = 8 * 1 = 8
Input: N = 4324
Product of digits at odd places = 4 * 2 = 8
Product of digits at even places = 3 * 4 = 12
- Find product of digits at even places and store it in prodEven.
- Find product of digits at odd places and store it in prodOdd.
- If prodEven = prodOdd then print Yes otherwise print No.
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.
- Count numbers from given range having odd digits at odd places and even digits at even places
- Check whether product of digits at even places is divisible by sum of digits at odd place of a number
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Check whether product of digits at even places of a number is divisible by K
- Find the sum of digits of a number at even and odd places
- Check whether sum of digits at odd places of a number is divisible by K
- Check if a number has an odd count of odd divisors and even count of even divisors
- Primality test for the sum of digits at odd places of a number
- Number formed by deleting digits such that sum of the digits becomes even and the number odd
- Count numbers in given range such that sum of even digits is greater than sum of odd digits
- Check if the number is even or odd whose digits and base (radix) is given
- Count of numbers in range which are divisible by M and have digit D at odd places
- Check whether count of odd and even factors of a number are equal
- Arrangement of the characters of a word such that all vowels are at odd places
- Smallest odd number with even sum of digits from the given number N
- Check whether product of 'n' numbers is even or odd
- Count total number of N digit numbers such that the difference between sum of even and odd digits is 1
- Count number of ordered pairs with Even and Odd Product
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Find the number of positive integers less than or equal to N that have an odd number of digits
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.