# Thread: arithmatic operations without using them..

1. ## arithmatic operations without using them..

Hi.

Without using /,% and * operators. write a function to divide a number by 3.

Can anyone help...

2. Strikes me as a homework problem. Ever heard of logarithms?

3. 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.

4. Threads merged with duplicate deleted.

5. Looks like an Adobe test from last year.

THanks

7. ## Yes...it is from Adobe test paper...

Originally Posted by robatino
Looks like an Adobe test from last year.

Yes...it is from Adobe test paper...

8. Originally Posted by ulillillia
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.
Presumably efficiency is part of the answer too. There is a logarithmic complexity solution to this problem