Hi.
I was reading a magzine.
It had this question
Without using /,% and * operators. write a function to divide a number by 3.
Can anyone help...
Printable View
Hi.
I was reading a magzine.
It had this question
Without using /,% and * operators. write a function to divide a number by 3.
Can anyone help...
Strikes me as a homework problem. Ever heard of logarithms?
Division is really repeated subtraction. Just take a base number, such as 8152 and subtract 3 from it, but add 1 to the count. When the number to subtract is less than the amount to be subtracted, stop. You have the answer and the remainder, if any. Just adding and subtracting is used.
cross-poster!
http://cboard.cprogramming.com/showthread.php?t=89936
Threads merged with duplicate deleted.
Looks like an Adobe test from last year.
http://www.google.com/search?q=%22wr...hl=en&filter=0
THanks