Microsoft Interview Question
Software Engineer / DevelopersI think it's just division with round-up to larger number:
5/2=2.5 -> rounding get 3
10/3=3.33.. -> rounding get 4
5/2 is not the same as 5 "divided by" 2 here.... the "/" i believe is just a factor added to confuse. This is what I think it is:
5 op 2 = 3 (5-2 = 3)
so shoudn't 10 op 3 be 10 - 3 = 7 ?
ans: 5
- Shekhar Agrawal February 20, 2011(5/2)
(5) 101 --- (2) right shifts --- gives 011 i.e. (3)
(10/3)
(10) 1010 --- (3) right shifts --- gives 0101 i.e. (5)