Write a Java program to check whether a given number is a Disarium number or an Automorphic number. A Disarium number is a number defined by the following process : Sum of its digits powered with their respective position is equal to the original number. For example 175 is a Disarium number : As 11+32+53 = 135 Some other DISARIUM are 89, 175, 518 etc. An automorphic number is a number whose square "ends" in the same digits as the number itself. For example, 52 = 25, 62 = 36, 762 = 5776 etc.
Answers
Answered by
1
Explanation:
A Disarium number is a number defined by the following process:
Sum of its digits powered with their respective position is equal to the original number.
For example 175 is a Disarium number:
As 11+32+53 = 135
Some other DISARIUM are 89, 175, 518 etc.
A number will be called Disarium if the sum of its digits powered with their respective position is equal with the number itself. Sample Input: 135.
Test Data
Input a number : 25
Similar questions
Math,
2 days ago
Social Sciences,
2 days ago
Math,
4 days ago
Science,
4 days ago
English,
8 months ago