GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2025 set2

GATE 2025 set2 · CS · NAT · 1 mark · Programming and Data Structures › C Programming Fundamentals

GATE 2025 set2 Computer Science and Information Technology question: code The output of the given C code segment is . (Answer in integer)

int x=126,y=105;
do {
    if(x>y) x=x-y;
    else y=y-x;
} while(x!=y);

printf("%d",x);

The output of the given C code segment is ________. (Answer in integer)

Show answer

Official answer: 21

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion