Question:medium

Instructions: A numerical machine accepts two values X and Y. At every step, it updates the values as X = X times Y, and Y = Y + 1. The machine stops as soon as X becomes greater than or equal to N.

For X = 3, Y = 2 and N = 100, how many steps are performed before the machine stops?

Show Hint

Multiply X by Y, then add 1 to Y, and stop the moment X reaches or passes 100.
Updated On: Jul 15, 2026
  • 2
  • 3
  • 4
  • 5
Show Solution

The Correct Option is C

Solution and Explanation

It helps to lay this out as a small table, tracking X and Y together after each update.

  1. Start: X = 3, Y = 2.
  2. After step 1: X = 3 × 2 = 6, Y = 2 + 1 = 3.
  3. After step 2: X = 6 × 3 = 18, Y = 3 + 1 = 4.
  4. After step 3: X = 18 × 4 = 72, Y = 4 + 1 = 5.
  5. After step 4: X = 72 × 5 = 360, Y = 5 + 1 = 6.

At the end of step 4, X = 360, which is the first time X reaches or crosses 100, so the machine halts right there.

So the correct answer is option C, 4 steps.

Was this answer helpful?
0


Questions Asked in SNAP exam