A special two-digit number is a number such that when the sum of the digits of the number is added to the product of its digits, the result is equal to the original two-digit number.
input : 59. output : 59 is a Special Two-Digit Number Explanation: Sum of digits = 5 + 9 = 14 Product of its digits = 5 x 9 = 45 Sum of the sum of digits and product of digits = 14 + 45 = 59 input: 29 output: 29 is a Special Two-digit Number Explanation: Sum of digits = 9 + 2 = 11 Product of digits = 9 * 2 = 18 Sum of the sum of digits and product of digits = 11 + 18 = 29
Extract the first and last digit of the number and add and multiply the digits separately. Then, add the sum and product of the digits of the two-digit number and compare it to the original number. If they are same, then it is a Special Two-Digit Number, else it is not.
Below is the implementation of above approach:
59 is a Special Two-Digit Number
- Check input character is alphabet, digit or special character
- 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
- 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
- Largest number less than N with digit sum greater than the digit sum of N
- Generate a number such that the frequency of each digit is digit times the frequency in given number
- Number of times a number can be replaced by the sum of its digits until it only contains one digit
- Count the number of occurrences of a particular digit in a number
- Largest number less than N whose each digit is prime number
- Number of n digit numbers that do not contain 9
- Nth number whose sum of digit is multiple of 10
- Sum of digit of a number using recursion
- Least Greater number with same digit sum
- Find the Number which contain the digit d
- Place Value of a given digit in a number
- Sum of n digit numbers divisible by a given number
- Largest and smallest digit of a number
- Smallest N digit number divisible by N
- Find the frequency of a digit in 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.
Improved By : jit_t