10

Number Puzzles III: Armstrong Numbers

 2 years ago
source link: http://programmingbydoing.com/a/number-puzzles-iii.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Number Puzzles III
  • Author: Graham Mitchell
  • Filename: ArmstrongNumbers.java

Number Puzzles III: Armstrong Numbers

Use nested for loops to find all the three-digit Armstrong numbers. Armstrong numbers are three digit numbers such that the sum of the digits cubed is equal to the number itself.

For example, 153 is an Armstrong number because 1³ + 5³ + 3³ = 153

However, 294 is not, because 2³ + 9³ + 4³ = 801 (not 294)


©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK