GATE CS 2025, set 2 · Question 8 · General Aptitude · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

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
  1. (A) X(i) = X(i-1) + I(i); Y(i) = Y(i-1)I(i); i > 0
  2. (B) X(i) = X(i-1)I(i); Y(i) = Y(i-1) + I(i); i > 0
  3. (C) X(i) = X(i-1)I(i); Y(i) = Y(i-1)I(i); i > 0
  4. (D) X(i) = X(i-1) + I(i); Y(i) = Y(i-1)I(i-1); i > 0
Answer

Answer (A)

Answer from the official GATE CS 2025 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes