Program to print all Disarium numbers between 1 and 100ExplanationIn this program, we need to display all Disarium number between 1 and 100. Disarium number A number is said to be a Disarium number when the sum of its digit raised to the power of their respective position is equal to the number itself. For example, 175 is a Disarium number as follows Formula11 + 72 + 53 = 1 + 49 + 125 = 175 Some of the other example of Disarium number are 89, 135, 518 etc. To find whether given number is Disarium or not, calculate the sum of digits powered with their respective positions. If the sum is equal to the original number then, the given number is Disarium number. Algorithm
SolutionPythonOutput: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 COutput: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 JAVAOutput: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 C#Output: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 PHPOutput: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India