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
How many links are needed given 5 stations connected as a mesh network configuration?
Answers (1)
A function is a predefined formula
Answers (1)
When is one effective way for employees to keep their skillets current
Answers (1)
In which part of a browser will you type the url of a website
Answers (1)
Which condition refers to a sudden and dramatic increase in voltage, which is usually caused by lighting?
Answers (1)
New Questions in Computers & Technology
What is not an impact of out-groups? Group of answer choices Out-groups have a negative impact on group synergy. Out-group members do not receive the respect they deserve from others. Out-group members create cohesiveness in the group.
Answers (1)
Which topology connects all the computers in a circular pattern
Answers (1)
New power sources develop as technology advances. Using complete sentences, identify some modern advancements in power sources.
Answers (1)
Which of these is NOT one of the main parts of an email? A. header B. subject C. body D. reply
Answers (2)
A defined set of standards that computers must follow in order to communicate properly is known as a
Answers (1)