Which of the following statements about global variables is true?

A. A global variable is accessible only to the main function.
B. A global variable is declared in the highest-level block in which it is used.
C. If a function contains a local variable with the same name as a global variable, the global variable's name takes precedence within the function.
D. A global variable can have the same name as a variable that is declared locally within the function.
E. All of these are true.

Answer: D. A global variable can have the same name as a variable that is declared locally within the function.

Computer Science & Information Technology

You might also like to view...

Which of the following is the correct order of the layers of the OSI model from layer 1 to layer 7?

A. Application, Presentation, Session, Transport, Network, Data Link, Physical B. Application, Session, Transport, Presentation, Network, Data Link, Physical C. Physical, Data Link, Network, Transport, Session, Presentation, Application D. Physical, Session, Network, Data Link, Transport, Presentation, Application

Computer Science & Information Technology

The ____ tab menu provides options to change the appearance of the chart labels, data markers, and dimensions.

A. CHARD TOOLS B. GRAPH TOOLS C. IMAGE TOOLS D. GRAPHIC TOOLS

Computer Science & Information Technology