ISRO exam 2016 – Question 26 with Solution
In this video we are going to discuss another question which was asked in the exam of ISRO
- Consider the following segment of C-code:
int j, n;
j = 1;
while (j <= n)
j = j * 2;
The number of comparisons made in the execution of the loop for any
n > 0 is:
- ⌊log2 n⌋ ∗ n
- n
- ⌈log2 n⌉
- ⌊log2 n⌋ + 1