Open In App

ISRO | ISRO CS 2007 | Question 15

Consider the following pseudo-code

x:=1;
i:=1;
while (x 

What is the value of i at the end of the pseudo-code?



(A) 4
(B) 5
(C) 6
(D) 7

Answer: (B)
Explanation: Initialisation: x = 1, i = 1;

Loop: x       i
     21       2
     22       3
     24       4
     216      5

After this condition becomes false.



So, i = 5, Option (B) is correct.
Quiz of this Question

Article Tags :