216. Given 5/2=3, what will be the output of 10/3?
Microsoft Interview Questions and Answers
(Continued from previous question...)
216. Given 5/2=3, what will be the output of 10/3?
Question:
Given 5/2=3, what will be the output of 10/3?
maybe an answer1:
it's just division with round-up to larger number:
5/2=2.5 -> rounding get 3
10/3=3.33.. -> rounding get 4
maybe an answer2:
5=101 base on 2, so the length is 3
10=101 base on 3, so the length is 3
maybe an answer3:
Solution : ( 3 * 2 * 10 ) / ( 5 * 3) = 4
maybe an answer4:
(5/2)
(5) 101 --- (2) right shifts --- gives 011 i.e. (3)
(10/3)
(10) 1010 --- (3) right shifts --- gives 0101 i.e. (5)
(Continued on next question...)
Other Interview Questions
|