GATE CS 2025, set 2 · Question 33 · Programming and Data Structures · Numerical answer (NAT) · 1 mark · no negative marks

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)

Answer

Answer 21

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