GATE Computer Science (CS) 2018 Shift 1 Solved Paper

© examsiri.com
Question : 61 of 65
 
Marks: +1, -0
Consider the following C code. Assume that unsigned long int type length is 64 bits.
Unsigned long int fun (unsigned long int n)
{
unsigned long int i, j = 0, sum = 0;
for (I = n; I > 1; I = i/2) j++;
for (; j > 1; j = j/2) sum++;
return (sum);
}

The value returned when we call fun with the input 240 is
Go to Question: