If a variable is defined inside a user-defined function, what is its “scope”,…
2026
If a variable is defined inside a user-defined function, what is its “scope”, and where can it be accessed?
Answer: B. Local Scope; it can only be accessed within that specific function.
- A.
Global Scope; it can be accessed anywhere in the entire program.
- B.
Local Scope; it can only be accessed within that specific function.
- C.
Universal Scope; it is saved to the hard drive for future use.
- D.
Static Scope; it can only be accessed by the main operating system.
Attempted by 593 students.
Show answer & explanation
Correct answer: B
Loading lesson…