Example 30: Armstrong Numbers
If the sum of cubes of each digit of the number is equal to the number itself, the number is called an Armstrong number. For instance,
Write a program to print out all Armstrong numbers between 1 and 500.
|1 153 370 371 407
Try it yourself
Try to solve this question on your own in the code widget below. If you get stuck, you can always refer to the solution provided.