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

6. Write a program to sum of digits of given integer number.

This assignment was a bit difficult for me because I still yet to get use to using the modulo operator.  Nevertheless, after researching the best approach, I soon came to realize that my code mimicked the sample source code.  Although there are some minor differences, it pretty much utilizes the same algorithm.  Below is my source code and output.  Also, I have included the sample source code and output for comparison.











Comments

Popular posts from this blog

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

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

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