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

Consider the following ANSI C function:
int SomeFunction(int x, int y) { if ((x == 1) || (y == 1)) return 1; if (x == y) return x; if (x > y) return SomeFunction(x - y, y); if (y > x) return SomeFunction(x, y - x); }
The value returned by SomeFunction(15, 255) is ______.

Answer

Answer 15

Answer from the official GATE CS 2021 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes