logo

Question detail

A subroutine has two parameters and three local variables. Which statement best describes the stack frame created for one call?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

A subroutine has two parameters and three local variables. Which statement best describes the stack frame created for one call?.

  1. A.It can contain the return address, the two parameters and the three local variables
  2. B.It contains only the return address because variables are stored in the program code
  3. C.It contains only the local variables because parameters are stored in the calling subroutine's frame
  4. D.It contains the return address but cannot contain values associated with variables

Model answer

What a good answer should say

  • It can contain the return address, the two parameters and the three local variables

Explanation

Why this works

A stack frame holds the information associated with a particular subroutine call. This includes the return address, parameter values and local variables.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.