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
What is the name of the option in most presentation applications with which you can modify slide elements?
Answers (1)
In what explicit way did Eye of the Storm include reader participation?
Answers (1)
Assume that grade is a variable whose value is a letter grade- - any one of the following letters: 'A', 'B', 'C', 'D', 'E', 'F', 'W', 'I'.
Answers (1)
Which of the following statements is true? A : Deltas form in the mountains. B : Rill erosion happens when sand is eroded by wind. C : Raindrops are too light to cause erosion. D : Wind erosion is most problematic in dry climates.
Answers (1)
A researcher wants to examine whether the size of the font of test questions affects scores on a test.
Answers (1)
New Questions in Computers & Technology
Choose the word or phrase that most nearly defines the underlined word. boo's transition from the basement to back home was nebulous in jem's memory. a. vivid b. clear c. indistinctd. dark
Answers (1)
In attempts to improve their contribution to the environment a company decides to adapt green computing. Which of these techniques will contribute to green computing? A) virtualization B) grid computing C) recycling D) autonomic computing
Answers (1)
When you skip count by 8 you skip over the secret number what could that number be?
Answers (1)
I know this is not homework/classwork, but i could not find a place to ask for an answer to my problem anywhere else. I have a stylus on my lenovo chromebook, it came with it. It does not use a battery.
Answers (1)
Which of the following is not a SQL*Loader file? A. Bad file B. Control file C. Discard file D. Good file E. Log file
Answers (1)