Please give hints to write program to divide 40 by 2 without using division operator.

Printable View

- 08-07-2011jag_cDivision without operators
Please give hints to write program to divide 40 by 2 without using division operator.

- 08-07-2011Salem
Study what the other operators do.

C Operator Precedence Table - 08-07-2011manasij7479
Study the bitwise ones more carefully.

- 08-08-2011grumpy
Just bear in mind that the equivalence of some bitwise operations with some mathematical operations is only guaranteed for unsigned integral types: don't rely on such equivalences for int, float, double ....

- 08-08-2011quzah
- 08-08-2011whiteflags
- 08-08-2011grumpy
You might want to consider that log(a/b) == log(a) - log(b) in any base (for a and b both positive).

No division on the right hand side of that expression .....