GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2023

GATE 2023 · CS · MCQ · 2 marks · Compiler Design › Runtime Environments

GATE 2023 Computer Science and Information Technology question: Consider the following program: code code code code Which one of the following options…

Consider the following program:

int main()
{
   f1();
   f2(2);
   f3();
   return(0);
}
int f1()
{
  return(1);
}
int f2(int X)
{
   f3();
  if (X==1)
    return f1();
  else
    return (X*f2(X-1));
}
int f3()
{
  return(5);
}

Which one of the following options represents the activation tree corresponding to the main function?

  1. (A)

    option

  2. (B)

    option

  3. (C)

    option

  4. (D)

    option

Show answer

Official answer: A

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion