Please give hints to write program to divide 40 by 2 without using division operator.
Please give hints to write program to divide 40 by 2 without using division operator.
Study what the other operators do.
C Operator Precedence Table
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
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 ....
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 .....