Division and Sum Digits
excerpt: This covers the basic building blocks such as reduction and counter. tags: inputvaluereductionbysubtraction counter modulooperator integerdivision inputvaluereductionbydivision choprightmostdigit
Implement a method to perform integer division, it must divide two given numbers.
Division


The key insight to solve this problem is that division is repeated subtraction.
Building Blocks
 Reduce Input Value by Subtraction
 Counter
Sum Digits
Write a method to sum the digits in a number.


Extract rightmost digit using integer division. The value is reduced by chopping off the rightmost digit.
Building Blocks
 Modulus
 Integer Division
 Reduce Input Value by Division