Programming Languages C++ Objective
Mar 19, 2013

Identify the correct statement regarding scope of variables.

Choose the correct answer:
A) Global variables are declared in a separate file and accessible from any program.
B) Local variables are declared inside a function and accessible within the function only.
C) Global variables are declared inside a function and accessible from anywhere in program.
D) Local variables are declared in the main body of the program and accessible only from functions.
Detailed Explanation

Option B is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback