Ask yourself, how many times does the cycle run? Create a table for the loop when the input n:
for(int k=1; k <= n; k = k * 2)
Iteration | k
-------------+-----
1 | 1
2 | 2
3 | 4
... | ...
... | ...
k | n
2 k = n → k = log (n)
n 4. :
Iteration | k
-------------+-----
1 | 1
2 | 2
3 | 4
... | ...
... | ...
k | n^4
2 k= n 4 → k = log (n 4) = 4 * log (n)