Franky5836 Franky5836
  • 23-08-2019
  • Computers and Technology
contestada

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

a) Global

b) Local

c) Within that file only

Respuesta :

Branta Branta
  • 26-08-2019

Answer:

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.

Answer Link

Otras preguntas

Which expression can be used to determine the slope of the linear function graphed below? On a coordinate plane, a line goes through points (0, negative 4) and
which statement best describes ecosystems
Part A Which of the following best states an important theme about life’s difficulties as described in “Ted’s Champion”? A. Children should always respect their
What word in the sentence provides a context clue to help find the meaning of the word episode?
How do I solve 622 - 133
Which phrases describe groundwater? Select three options
Which country is located primarily on the jutland peninsula
Which of the following principles describes a design that is equally visually weighted and filled with interest? OOOO texture rhythm balance proportion
what power of 7 is 2041? 2041=7^6-2x
the passage is smartphones put your privacy at risk