Question 93Asked in BPSC TRE 2.0 (2023) Computer Class 9-10

What is the scope of the variable declared in the user-defined function?

  1. AWhole program
  2. BOnly inside the { } block
  3. CInside the main function
  4. DMore than one of the above
  5. 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.

From BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper

This is question 93 of BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.