Answer:
4
Step-by-step explanation:
Initially the values are N = 4 and K = 1
k=1:
While 1 <= 4 // true
X[1] = 1^2 =1
K = 1 + 1 =2
k=2:
While 2 <= 4 // true
X[2] = 2^2 =4
K = 2 + 1 = 3
k=3:
While 3 <= 4 // true
X[2] = 3^2 =9
K = 3 + 1 = 4
k=4:
While 4 <= 4 // true
X[2] = 4^2 =16
K = 4 + 1 = 5
k=5:
While 5 <= 4 // false
End While
Write X[4/2] => X[2] = 4
Write X[1] + " " + X[4 - 1]
Write X[1] + " " + X[3] // here x[1] = 1 and x[3] = 9 it print 1 9
Output:
4
1 9
The first line of output displays the value 4.