Consider the function
int func(int num) { int count=0; while(num) { count++; num>>=1; } return(count); }
For $func(435)$ the value returned is
https://gateoverflow.in/1964/gate2014-2-10
num>>1 is equivalent to num/2
in while loop , value of num will change as follows:
Since it looped 9 times value of count will be 9
Answer is A
plz refer here: https://gateoverflow.in/1964/gate2014-2-10
64.3k questions
77.9k answers
244k comments
80.0k users