If a variable is created inside a function (a Local Variable), what happens to…

2026

If a variable is created inside a function (a Local Variable), what happens to that variable once the function finishes its execution and returns a value?

Answer: C. It is “destroyed” or removed from memory and its value is no longer accessible.

  1. A.

    It is stored in the global memory for the rest of the program’s life.

  2. B.

    It is permanently saved to the hard drive.

  3. C.

    It is “destroyed” or removed from memory and its value is no longer accessible.

  4. D.

    It is renamed automatically to avoid confusion with other variables.

Attempted by 291 students.

Show answer & explanation

Correct answer: C

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…