GATE CS 2023 (Forenoon) — Question 36

Programming in CFunctions, Parameter Passing, Scope Rules, RecursionMCQ2 marks · −2/3 if wrongMedium

Consider the following program:
c
1int main( )
2{
3    f1( );
4    f1(2);
5    f3( );
6    return (0);
7}
8int f1( )
9{
10    return(1);
11}
12int f2(int X)
13{
14    f3( );
15    if (X == 1)
16        return f1( );
17    else
18        return (X * f2(X - 1));
19}
20int f3( )
21{
22    return(5);
23}
24
Which one of the following options represents the activation tree corresponding to the main function?
  1. A
    Question image
  2. B
    Question image
  3. C
    Question image
  4. D
    Question image
Practise the full 2023-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAFree All-India Mock — every SundayA full GATE CS paper, exactly 180 minutes, ranked across India with your GATE score.
Practise more on Functions, Parameter Passing, Scope Rules, RecursionTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group