Question 77

Computer Awareness Data Structure Medium

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

(A) in whole program
(B) only inside the } block
(C) Both 1 and 2
(D) None of these
✓ Correct Answer: Option B Verified Solution

📘 Step-by-Step Solution & Detailed Explanation:

In programming, the scope of a variable determines where in the program that variable can be accessed. When a variable is declared in a user-defined function, its scope is local to that function. This means: \[\] The variable is only accessible inside the function where it is defined. \[\] It is not accessible in the rest of the program or in other functions. The scope of the variable declared in the user-defined function is: only inside the block Final Remarks The local scope of a variable ensures that it can only be accessed and manipulated within the user-defined function in which it is declared. \[\] Correct Answer: (b)

Practice Similar Data Structure Questions

Reinforce your conceptual grasp with related questions from CUET-MCA 2021:

Q35 Which of the following standard algorithms is not a greedy algorithm?
Solve →
Q54 Which of these operators is used to allocate memory to array variable in...
Solve →
Q56 Consider the following function implemented in C \[\] void test fun(int x,...
Solve →
Q66 What happens if the following program is executed in C and C++? \[\]int...
Solve →
Q69 What is the output of this C code? \[\]void main() \[\]int x = 18;...
Solve →
Full-Length Test Series

Prepare for CUET-MCA Under Real Exam Conditions

Take timed full-length mock tests with authentic question distributions, negative marking (+12/-3 in Math), and instant All India Rank calculation.

Start Free Mock Test Series →