Q. 20 Consider the function func shown below:

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

The value returned by func (435) is _____.

(A) 8

(B) 9

(C) 10

(D) 11

Answer: (B)

Explanation:

Gate CS-2014-2 Question Paper With Solutions

Learn More:   Gate EE-2011 Question Paper With Solutions