Ask Question
1 April, 17:38

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.

+1
Answers (1)
  1. 1 April, 18:29
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers
You Might be Interested in
What is one reason the number of DUIs has dropped?
Answers (1)
True or False MAC addresses are assigned by the router along with your IP address.
Answers (1)
The top element in the hierarchy is the html element, which contains all of the other elements within a Hypertext Markup Language (HTML) file. True or false?
Answers (1)
User access to network resources falls into one of these two categories: 1) the privilege or right to execute, install, and uninstall software, and 2) permission to read, modify, create, or delete data files and folders.
Answers (1)
which printing technique involves working on precise codes that are encoded and stored in a storage medium?
Answers (1)
New Questions in Computers and Technology
The practice of texting is most popular in what age group? a. 8 through 15 b. 13 through 22 c. 17 through 26 d. 25 through 39
Answers (1)
Dr. Blahbah has implemented a system with an 8-bit random canary that is used to detect and prevent stack-based buffer overflow attacks. Describe an effective attack against. Dr. Blahbah's system and analyze its likelihood of success.
Answers (1)
Explain in three to four sentences what happens to data packets once they leave a node.
Answers (1)
What text results in variable whitespace?
Answers (2)
What is the use of a ceiling fan
Answers (1)