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

You are considering buying a square wall poster that has an area of 6.25 ft.² find the side length of the wall poster
Which of the following is a moderate to vigorous sport that a student can participate in at school with teammates? Volleyball Archery Tennis Baseball
The problem that developed between the United States and Mexico when Texas became the 28th state was that
what is b/3+1/8=19I need help
What new system of national government did the delegates agree upon at the constitutional convention of 1787?
millie has a box of 1 hundred cubes. she also has a bag of 70 cubes. how many trains of 10 cubes can she make?
If y=14 when x=8, find y when x=12   Directly proportional
Which Is bigger 2460cm or 0.024km
True or False: The Eastern Orthodox Church forbids the use of icons.
painted a summer landscape with heat-filled shapes known as Summer Afternoon.