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) | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Input (I) | 20 | -4 | 10 | 15 |
| Output (X) | 20 | 16 | 26 | 41 |
| Output (Y) | 20 | -80 | -800 | -12000 |
- (A) X(i) = X(i-1) + I(i); Y(i) = Y(i-1)I(i); i > 0
- (B) X(i) = X(i-1)I(i); Y(i) = Y(i-1) + I(i); i > 0
- (C) X(i) = X(i-1)I(i); Y(i) = Y(i-1)I(i); i > 0
- (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