Ask Question
18 January, 21:37

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.

+4
Answers (1)
  1. 18 January, 21:47
    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?
Find 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 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
You Might be Interested in
An organization wants to upgrade its enterprise-wide desktop computer solution. The organization currently has 500 PCs active on the network.
Answers (1)
What is the best temperature to set your air conditioner on?
Answers (1)
After a multicast transmission has begun, what option causes connected clients to finish the install, but prevents new clients from connecting to the transmission?
Answers (1)
The area on the east side of the map is commonly referred to as
Answers (1)
Value: 3 Word inserts a blue underline in your document. What is the error? O a. There is a grammatical error. Ob. A word is correctly spelled but is used incorrectly in a document. O c. A proper name is misspelled.
Answers (1)
New Questions in Computers & Technology
What must you consider when determining the efficiency of an algorithm? Select two choices. a. The language in which the program is written b. The amount of resources, such as storage, required c. The number of characters used to write the program d.
Answers (1)
How to use translate on a website?
Answers (1)
When we consider data quality, what are the differences among validity, reliability, and representativeness? How can you know the data have high levels of these characteristics?
Answers (1)
You are creating a budget for your new business. What should you include? A. All income and expenses. B. Fixed expenses but not income. C. Income but not variable expenses. D. Fixed and variable expenses but not taxes.
Answers (1)
This resume format focuses on the tasks or skills that an applicant can perform is what? A chronological B functional C electronic or D scannable
Answers (1)
Sign In
Ask Question