Question 82

Logical Reasoning Percentage Medium

A hand-held gaming device takes X and Y as two input values. These values get updated as X=XY/2 and Y=Y+1 at each iteration and the game stops when X is greater than or equal to N. For X=2, Y=4 and N=3000, what would be the final value of X when the game stops?

(A) 5450
(B) 9450
(C) 12860
(D) 13450
View Dynamic Solution & Explanation
Correct Solution: Option B

Step-by-step Solution:

Let's trace the loop iterations manually starting with $X = 2$, $Y = 4$, and $N = 3000$. Iteration 1: $$ X = \frac{2 \times 4}{2} = 4 $$ $$ Y = 4 + 1 = 5 $$ Iteration 2: $$ X = \frac{4 \times 5}{2} = 10 $$ $$ Y = 5 + 1 = 6 $$ Iteration 3: $$ X = \frac{10 \times 6}{2} = 30 $$ $$ Y = 6 + 1 = 7 $$ Iteration 4: $$ X = \frac{30 \times 7}{2} = 105 $$ $$ Y = 7 + 1 = 8 $$ Iteration 5: $$ X = \frac{105 \times 8}{2} = 420 $$ $$ Y = 8 + 1 = 9 $$ Iteration 6: $$ X = \frac{420 \times 9}{2} = 1890 $$ $$ Y = 9 + 1 = 10 $$ Iteration 7: $$ X = \frac{1890 \times 10}{2} = 9450 $$ $$ Y = 10 + 1 = 11 $$ At this point, $X = 9450$, which is $\geq 3000$. The game stops, and the final value of $X$ is 9450.