Consider the function int func(int num) { int count = 0; while(num) { count++;…

ISRO Scientist/Engineer SC 2017

Consider the function

int func(int num) {
int count = 0;
while(num) {
count++;
num >>= 1;
}
return(count) ;
}

For func(435) the value returned is

  1. A.

    9

  2. B.

    8

  3. C.

    0

  4. D.

    10

Attempted by 825 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…