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
You work for a small startup company that just hired five new employees, doubling its number of team members.
Answers (1)
2. Fabulously Fit offers memberships for $35 per month plus a $50 enrollment fee. The Fitness Studio offers memberships for $40 per month plus a $35 enrollment fee. In how many months will the fitness clubs cost the same? What will the cost be?
Answers (1)
A technician is at a small facility that has five computers connected to a central switch and accessing a single server for file and print sharing.
Answers (1)
What is a spacecraft virus?
Answers (2)
Which of the following is even 2, 3, 5, 7
Answers (2)
New Questions in Computers & Technology
What is the language of computers?
Answers (1)
Which of the following is a command shell with a built-in scripting language?1. The Server Manager's Roles and Features wizard2. Secure Shell (SSH) 3. Domain Name Services4. PowerShell
Answers (2)
An authentication system that uses something a user has in conjunction with something a user knows is called:
Answers (1)
g 4.16 Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is:
Answers (1)
You have deployed several 802.11b wireless networks at your company's location. Recently, users complained that they were having trouble connecting to the wireless networks.
Answers (1)