Question

Which one of the following options is correct for the given data in the table?

Iteration (i)0123
Input (I)20-41015
Output (X)20162641
Output (Y)20-80-800-12000
Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2025 answer key

Solution

Check how X(i)X(i) and Y(i)Y(i) are computed from the previous output and current input I(i)I(i) for i=1,2,3i = 1, 2, 3.

From the table:

  • For X(i)X(i): X(1)=20+(−4)=16X(1) = 20 + (-4) = 16, X(2)=16+10=26X(2) = 16 + 10 = 26, and X(3)=26+15=41X(3) = 26 + 15 = 41. Thus X(i)=X(i−1)+I(i)X(i) = X(i - 1) + I(i) for i>0i > 0.
  • For Y(i)Y(i): Y(1)=20×(−4)=−80Y(1) = 20 \times (-4) = -80, Y(2)=(−80)×10=−800Y(2) = (-80) \times 10 = -800, and Y(3)=(−800)×15=−12000Y(3) = (-800) \times 15 = -12000. Thus Y(i)=Y(i−1)I(i)Y(i) = Y(i - 1)I(i) for i>0i > 0.
Final answer

Option (A)

Common trap

Selecting (D) without noticing I(i−1)I(i - 1) instead of I(i)I(i) in the formula for Y(i)Y(i).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
Question
8 of 65
Section
General Aptitude

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.