Ask Question
21 April, 11:11

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.

+2
Answers (1)
  1. 21 April, 11:19
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers
You Might be Interested in
The northern half of this continent is primarily rainforest and savanna. Australia Africa North America South America
Answers (1)
A virtual meeting is the same thing as a/an A. online meeting. B. VoIP. C. seminar. D. convention.
Answers (1)
Once artwork is inserted into a placeholder, it can be moved around on a slide. True/False
Answers (2)
Mr. Brody made a spreadsheet with student names in order to take attendance. Which method is best for sorting this data? A. Age B. Alphabetical C. Gender D. Homeroom
Answers (1)
Which file format results in the smallest file size
Answers (1)
New Questions in Computers & Technology
What is the difference between a learner's license and a driver's license? Name the written test a potential driver must pass and list the minimum required score to earn a learner's license.
Answers (1)
Are websites required to keep logs of visitors by law?
Answers (1)
Recall when you built your binary message sending device. Why did we decide to send a message as a sequence of states (A and B) rather than modifying our devices to represent more states (State C, State D, State E, ...)
Answers (1)
Public-key cryptography can be used for encryption (ElGamal for instance) and key exchange. Furthermore, it has some properties (such as nonrepudiation) which are not offered by secret key cryptography.
Answers (2)
What kind of heat we feel from the sun
Answers (2)