1
GATE AI 2025
Numerical
+2
-0

Consider the following pseudocode.

Create empty stack S

set $x=0$, flag $=0$, sum $=0$

Push $x$ onto $S$

while ( $S$ is not empty) $\{$

if (flag equals 0){

Set $x=x+1$

Push $x$ onto S}

if ( $x$ equals 8 ):

Set flag $=1$

if (flag equals 1){

$x=\operatorname{Pop}(\mathrm{S})$

if ( $x$ is odd):

Pop (S)

Set sum $=\operatorname{sum}+\mathrm{x}\}$

}

Output sum

The value of sum output by a program executing the above pseudocode is________

Your input ____
2
GATE AI 2025
MCQ (Single Correct Answer)
+1
-0

Courage : Bravery :: Yearning :

___________ Select the most appropriate option to complete the analogy.

A
Longing
B
Yelling
C
Yawning
D
Glaring
3
GATE AI 2025
MCQ (Single Correct Answer)
+1
-0

We ___________ tennis in the lawn when it suddenly started to rain. Select the most appropriate option to complete the above sentence.

A
Have been playing
B
Had been playing
C
Would have been playing
D
Could be playing
4
GATE AI 2025
MCQ (Single Correct Answer)
+1
-0

A $4 \times 4$ digital image has pixel intensities $(U)$ as shown in the figure. The number of pixels with $U \leq 4$ is:

0 1 0 2
4 7 3 3
5 5 4 4
6 7 3 2
A
3
B
8
C
11
D
9

GATE Data Science and Artificial Intelligence Papers

All year-wise previous year question papers