CPPForSchool.com: Flow of Control Set 2: Assignment 11

11. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number.
For example, 153 = ( 1 * 1 * 1 ) + ( 5 * 5 * 5 ) + ( 3 * 3 * 3 )


Unfortunately, this is the first time I have been introduced to the concept of an Armstrong number.  With that said, I went ahead and researched the best ways to handle this assignment.  Apparently, this is a common task in programming because there are tons of examples.  Just in case, I decided to utilize the sample source and solution for this exercise.








Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 7