Armstrong Number
Easy 20 XPMath
Commonly asked at TCS, Infosys, Zoho
An Armstrong number equals the sum of its digits each raised to the power of the number of digits. For example 153 = 1³ + 5³ + 3³. Read n and print Yes or No.
- Input
- One non-negative integer n.
- Output
- Yes or No.
Sample 1
Input
153
Output
Yes
Sample 2
Input
123
Output
No
Read input with input() (no prompt message) and print only the answer. Run tries the Input box; Submit checks all test cases.
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.The solution unlocks after 3 submissions.