write a program to accept any number and check whether it is a disarium number or not
pls answer
Answers
Answered by
2
Answer:
In python:
_______________________
n=int(input("Enter a number: "))
b=str(n)
s=0
for i in range(0,len(b)):
s=s+int(b[i])**(i+1)
if n==int(s):
print("Yes, it is a Disarium")
else:
print("No, it's not a Disarium")
________________________
Picture in the attachment.
Explanation:
Disarium is a number whose each digit when raised to the power of their position number return the same number, as in 175,
.
Attachments:
Similar questions
Social Sciences,
2 months ago
English,
2 months ago
Business Studies,
2 months ago
English,
4 months ago
Science,
9 months ago
India Languages,
9 months ago
Math,
9 months ago