Question
Easy

A variable declared within the block {} has the following scope:

1
File Scope
2
Local Scope
3
Class Scope
4
Global Scope
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter:
Topic:
Correct Answer
Option B
Explanation

The correct option is (2): In the context of programming languages such as C and C++, a variable declared inside an arbitrary block of code, delimited by curly braces ({}), is said to have Local Scope or, more specifically, Block Scope. The fundamental principle of this scope is that the variable is created when the program execution enters the block and is automatically destroyed when the execution exits the block.тАжRead More