Consider the following ANSI C function:
The value returned by SomeFunction(15, 255) is _________.
c
Programming in CFunctions, Parameter Passing, Scope Rules, RecursionNAT1 markMedium
1int SomeFunction(int x, int y)
2{
3 if ((x == 1) || (y == 1)) return 1;
4 if (x == y) return x;
5 if (x > y) return SomeFunction(x - y, y);
6 if (y > x) return SomeFunction(x, y - x);
7}
8A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.