All Exams Test series for 1 year @ ₹349 only
Question

Which of the following is not true about Global Variables:

This question was previously asked in
UGC NET 2024 Computer Science and Applications Question Paper (23-Aug-2024) (Shift 1)
The correct answer is

A function that uses global variables does not suffer from reusability.

A global variable is declared outside all functions and is visible to every function in the program. Using globals to pass data between functions has well-known drawbacks (Balagurusamy, Programming in ANSI C).

Statement on inadvertent change: true. A called function can modify a global, so a value the caller relies on can be changed by mistake.

Statement on independence: true. Functions are meant to be independent, isolated modules; a function tied to globals depends on outside state and loses that character.

Statement on readability: true. Since the data is not passed as arguments, a reader cannot see from the call which values the function actually uses.

Statement on reusability: not true. A function that depends on global variables cannot be moved to another program without also carrying those globals, so it does suffer from poor reusability. Claiming it does not suffer is the false statement.

A function that uses global variables does not suffer from reusability. option is correct.

Was this answer helpful?

Important Questions from Scope of a Variable

  1. Consider the following program in C:
    #include <stdio.h>
    void func(int i, int j) {
    if(i < j) {
    int i = 0;
    while (i < 10) {
    j += 2;
    i++;
    }
    }
    printf("%d", i);
    }
    int main() {
    int i = 9, j = 10;
    func(i, j);
    return 0;
    }

    The output of the program is _________. (answer in integer)
    Note: Assume that the program compiles and runs successfully.
Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
297 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App