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
In order to generate a random number, you must use Math. random (). Group of answer choices True False
Answers (1)
Who sponsors apprenticeship programs
Answers (1)
Which of the following reflects the fourth step of effective communication? a. Amanda listened to her ebook on her way to work. b. Christine confronted KC about their group project. c. Ethan told Jacqueline about his latest invention. d.
Answers (2)
Why when I changed my display resolution on my laptop it made a vertical line on the screen?
Answers (1)
what is a massive online storage that allows for Access by any internet-connected device running web browser. use for Less private files
Answers (1)
New Questions in Computers & Technology
Hey! can any one tell me how to take a screen shot on intex aqua y2 pro?
Answers (1)
Put these prefixes in order from biggest to smallest. Mono- Tri- Hexa- Di-
Answers (1)
NEED NOW! Josiah needs to create an internal link to cell A4 on a worksheet named Sales Data within the same workbook that he is presently working in. What is the correct syntax for this scenario? =A4 =Sales! A4 =A4! Sales! =A4Sales!
Answers (1)
Firewalls inspect data transmitted between a computer and external recipients to prevent unsolicited data exchanges
Answers (1)
On large computers, the operating system switches back and forth among multiple programs stored in memory in order to overlap input and output operations with processing time; the purpose of this switching is to maximize the work done by the CPU.
Answers (1)