Answer:
k - 1 times
Explanation:
Given
The attached code snipped
Required
Maximum number of times, the print statement is executed
From the iteration, we have: i = 2; i<=k; i++
This means that; i = 2 to k
Say: [tex]k = 5[/tex]
[tex]i = 2, 3,4,5[/tex] (4 values) i.e. 5 - 1
Say [tex]k = 10[/tex]
[tex]i = 2,3,4,5,6,7,8,9,10[/tex] (9 values) i.e. 10 - 1
So, the maximum number of times is k - 1