mediumFPSCNTSCSSPPSCFIAOTSIBASTSECATProgramming & Databases
Answer explanation
Explanation included
Practice quiz ready
Question

Where is a local variable normally accessible?

AEverywhere on the internet
BOnly within the block or function where it is declared
COnly inside a database
DIn every program running on the computer

Choose an option to check yourself, or reveal the answer and explanation instantly.

Continue practising this MCQ topic

Use these links to review the full topic, start a timed quiz, or open the exam hub connected with this question.

Previous
What is a global variable?
Next
What does variable scope determine?

Related Programming & Databases MCQs

View all

Test Yourself

Take a full quiz on Programming & Databases

Start Quiz

Exam Coverage

Trust

Answer is visible after reveal
Explanation helps learning
Free topic quiz available

Subject

Programming & Databases

Save your progress

Create a free account to bookmark MCQs and track weak areas.

Register Free
Start QuizNext MCQ
Answer and explanation

Correct Answer: B: Only within the block or function where it is declared

Explanation: A local variable is normally accessible only within the function, method or block in which it is declared. It is generally created when that scope is entered and becomes unavailable when execution leaves it. Local variables reduce unwanted interaction between separate parts of a program.

Continue practice

More Programming & Databases MCQs with answers

Use these links to review related questions, practise the full topic, or open the exam preparation pages connected with this MCQ.

Related questions

Topic and exam paths