Ask Question
21 April, 11:11

Which of the following statements about global variables is true? (A) A global variable is declared in the highest-level block in which it is used. (B) A global variable can have the same name as a variable that is declared locally within a function. (C) Global variables cannot be declared in C++. (D) A global variable is accessible only to the main function.

+2
Answers (1)
  1. 21 April, 11:19
    0
    (B) A global variable can have the same name as a variable that is declared locally within a function.

    Explanation:

    The variables which are declared outside of all functions in the program are called global variables and variables that have scope limited to function or a block are called local variables.

    For example:-

    #include

    using namespace std;

    int g=50;

    int main ()

    {

    int g=100;

    cout<<"Local g = "<
  2. Comment
  3. Complaint
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following statements about global variables is true? (A) A global variable is declared in the highest-level block in which it ...” 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
You Might be Interested in
Which is a special workbook a user can create and then use as a pattern to create new, similar workbooks or worksheets?
Answers (1)
A weather app records the current temperature to the nearest degree Fahrenheit using an int variable temp.
Answers (1)
Tawni made some changes to her file and wants to save the changes in a document with a different title. How can she do this? by using the Save tab by using the Ctrl+S keys by using the Save As tab by using the Ctrl+A keys
Answers (2)
Place the following events in sequence: A) Take notes; B) Preview; C) Discuss with friend AA, C, B incorrect answer BC, A, B incorrect answer CB, C, A incorrect answer DB, A, C incorrect answer
Answers (2)
According to the text, what animal inspired the Wright Brother's? Group of answer choices pigeons vultures sloths bats nvm
Answers (1)
New Questions in Computers & Technology
Which option describes how to apply a left indent to a selected paragraph? Press Ctrl+M on your keyboard to insert a left indent. Drag the left indent marker on the ruler to create a left indent.
Answers (1)
Which windows component can be used to display information such as weather forecasts?
Answers (1)
in java A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent.
Answers (1)
How do humans sense movement?
Answers (1)
La computadora es un medio de comunicacion moderno?
Answers (1)