i would like to build off this post and ask if it is possible to write a division funciton using only +,-,while,do,for,if,else?
I like the witches math function, and saw the answer for the prior request at that point.
How could you modify that to do division?Code:int multiply(int a, int b) { int ret = 0; for (int i = 0; i < a; i++) ret += b; return ret; }
The only way i can think of would be to turn the value into a string array by using modulus by 10 or something like that. Is there a simple way to calculate this?