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 does CPA stand for?
Answers (2)
Def sum_divisors (n) : sum = 1 # Return the sum of all divisors of n, not including n x=int (n**0.5) for i in range (2, (x//1) + 1) : if n%i==0: sum=sum+i if n%i==0 and n/i!
Answers (1)
There is a simple pattern for determining if a binary number is odd. What is it and why does this pattern occur
Answers (1)
In which of the following situations would you want to use a word processing template? A. You need to write a letter to a company you'd like to work with, and have specific questions to ask. B.
Answers (2)
George is a big fan of the artist whose second album, Like a Virgin, was a huge success in 1984. George is a fan of
Answers (1)
New Questions in Computers and Technology
What is the difference between a spreadsheet and word processing software? Only one can calculate numeric data. Only one can display graphs and charts. Only one can organize data. Only one can present text and numeric data.
Answers (2)
Suppose income is 4001, what is the output of the following code? if (income > 3000) { System. out. println ("Income is greater than 3000"); } else if (income > 4000) { System. out. println ("Income is greater than 4000"); }
Answers (1)
What component of effective feedback is demonstrated by giving examples of what an employee is doing right instead of just praising their performance?
Answers (1)
Network address translation (NAT) protects against unsolicited incoming packets, but not against other types other types of network activity, such as "drive-by downloads." Explain how NAT protects against unsolicited incoming packets.
Answers (1)
How do you know if a printer needs routine maintenance?
Answers (1)