Question 93Asked in BPSC TRE 2.0 (2023) Computer Class 9-10What is the scope of the variable declared in the user-defined function?
- AWhole program
- BOnly inside the { } block
- CInside the main function
- DMore than one of the above
- ENone of the above
Show answerHide answer
Correct answer: (B) Only inside the { } block
Explanation
A variable declared inside a function is local and visible only within that function's { } block.