Ask Question
5 April, 05:25

The scope of a variable declared outside of any function is:

a) Global

b) Local

c) Within that file only

+3
Answers (1)
  1. 5 April, 06:09
    0
    a) Global

    Explanation:

    The scope of a variable declared outside of any function is Global.

    Let us consider an example:

    int g;

    int add (int a, int b) {

    return a+b;

    }

    int subtract (int a, int b) {

    return a-b;

    }

    Here the variable g is defined outside any function and is accessible anywhere within the program. This is a global variable.

    Variables defined within each function - a, b on the other hand have a local scope are are visible only within their respective function bodies.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The scope of a variable declared outside of any function is: a) Global b) Local c) Within that file only ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers