Question :
Write a menu driven program to accept a number from the user and check it is a Disarium number or Automorphic number according to user's choice.
Hint:
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 135 is a Disarium number:
As 1^1+3^2+5^3 = 135
A number will be called Disarium if the sum of its digits powered with their respective position is equal with the number itself.
A number is called Automorphic number if and only if its square ends in the same digits as the number itself.
Examples :
Input : N = 76
Output : Automorphic Explanation: As 76*76 = 5776
Input : N = 25
Output : Automorphic As 25*25 = 625
Answers
Answered by
0
Answer:
Write a menu driven program to accept a number from the user and check it is a Disarium number or Automorphic number according to user's choice.
Hint:
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 135 is a Disarium number:
As 1^1+3^2+5^3 = 135
A number will be called Disarium if the sum of its digits powered with their respective position is equal with the number itself.
A number is called Automorphic number if and only if its square ends in the same digits as the number itself.
Examples :
Input : N = 76
Output : Automorphic Explanation: As 76*76 = 5776
Input : N = 25
Output : Automorphic As 25*25 = 625
Explanation:
Similar questions