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 is the term for figures used to measures economic performance?
Answers (1)
Which number is the smallest? 4.4 ⋅ 10^-5, 3.99 ⋅ 10^-6, 2.6 ⋅ 10^3
Answers (1)
Which feature of a microblog allows a user to repost another users content?
Answers (2)
Which of the following must be involved in solving a scientific problem? A. Experimenting in a laboratory B. Taking measurements in the field C. Charting the data in a graph D. Asking testable questions
Answers (1)
If a front passenger over 18 is not restrained by a seat belt, he or she is legally at fault. A. True B. False
Answers (1)
New Questions in Computers & Technology
The purpose of a WAN is to connect two or more LANs. True or False
Answers (1)
Who does CIO report to?
Answers (1)
Which of the following is controlled by a computer operating system? a. System hardware (CPU, memory, storage, I/O devices) b. Application software (games, browser, office productivity, etc.) c. Both a and b d. Neither a nor b
Answers (1)
William found out that someone used his report on american culture without his permission. what is william a victim of?
Answers (1)
System is one in which you duplicate functions in order to improve the reliability and availability of a system.
Answers (1)