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

GATE · 2025 · CS · Set 2 · Computer Science & IT

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)

Attempted by 418 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…