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

5. Write a program to reverse any given integer number.


It appears that this assignment had a typo.  Originally, it was listed as "... reveres any given number."  Through deductive reasoning, it makes sense for it to actually be listed as "reverse" because "reveres" is not a word I can find anywhere.

Nevertheless, in order to accomplish this assignment, I will need to utilize the modulo operator once again.  Admittedly, I had performed additional research to ensure that my approach would be correct.  Ultimately, I settled with the example provided by Programiz.  Below is my source code, inspired by the Programiz version.






Of course, I had to test it with the example variables.  It worked successfully.  Comparison screenshots below.




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