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
What does a converter do? A. It converts one technological system into another. B. It converts one type of electrical signal into another. C. It converts one method of waste disposal into another. D.
Answers (2)
I need to know what the answer is the equation 2+2
Answers (1)
Which of the following statements is NOT true regarding ERP? A. ERP promises slow, but accurate, information. B. ERP allows companies share a common database and business practices throughout the enterprise. C.
Answers (1)
The cloud deployment model that is used for shared infrastructure between several organizations with common concerns (security, compliance, jurisdiction, etc.
Answers (1)
What is the technical factor considered while designing a building? A. the balance of a building B. the shape of the building C. the materials used D. the emotion portrayed by the building
Answers (1)
New Questions in Computers & Technology
Data for which there is temporarily no room in RAM is diverted to where on your computer? A. The paging file on the hard drive B. The system file on the hard drive C. The memory file on the hard drive D. The CPU cache
Answers (2)
The Presonus Studio Live 24 console has analog D-sub direct outputs. What cable would you need to connect this to a HD Analog interface?
Answers (2)
As network administrator, what is the subnet mask that allows 510 hosts given the ip address 172.30.0.0,
Answers (1)
What factors represents one of the sources of value derived from network effects?
Answers (1)
The advanced boot options screen can be displayed by pressing what key during the boot sequence?
Answers (1)