Difference between revisions of "TADM2E 1.28"

From Algorithm Wiki
Jump to: navigation, search
(Recovering wiki)
(No difference)

Revision as of 18:14, 11 September 2014

<pre> // Note: This only works for positive values! int divide(int numerator, int denominator) {

 int quotient = 0;
 while(numerator >= denominator) {
     numerator -= denominator;
     quotient++;
 }
 return quotient;

} </pre>