Solution
The correct answer is option 4
Explanation
Since a > 1 and a < b
int x=0 , int p=1
Let us assume a=2 and b=15
Whenever the loop is entered, the value of p is doubled and the value of x is incremented by 1.
In iteration 1: p = 2, x = 1
In iteration 2: p = 4, x = 2
In iteration 3: p = 8, x = 3
In Iteration 4: p = 16, x = 4
Final values are a = 2, b = 15, p = 16, x = 4
From the above values, it can be seen that x =[logab]