Ask Question

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

a) Global

b) Local

c) Within that file only

+3
Answers (1)
  1. 24 June, 18:53
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers