Variables which can be accessed by all modules of the program is called —

2019

Variables which can be accessed by all modules of the program is called —

Answer: A. GlobalVariables that can be accessed by all modules of a program are known as global variables. These variables are declared outside any function or block and are…

  1. A.

    Global

  2. B.

    Auto

  3. C.

    Static

  4. D.

    Local

  5. E.

    Dynamic

Attempted by 1490 students.

Show answer & explanation

Correct answer: A

Variables that can be accessed by all modules of a program are known as global variables. These variables are declared outside any function or block and are accessible throughout the entire program.

Auto variables are created within a function and are destroyed when the function ends. They are not accessible outside the function, so they cannot be accessed by all modules.

Static variables retain their value between function calls but are typically limited to the file or function scope unless explicitly declared as global. They are not accessible across all modules by default.

Local variables are confined to the function or block in which they are declared. They cannot be accessed outside their scope, so they do not meet the requirement.

Dynamic variables are created at runtime and their scope depends on how they are declared. They are not guaranteed to be accessible across all modules.

Explore the full course: Bihar Stet Paper Ii Computer Science

Loading lesson…