What is the scope of a global variable?
Variable Scope

Quiz
•
Computers
•
9th Grade
•
Hard
Vernon Leigh
Used 6+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The entire program
The sub-program where it has been declared
Only within the function where it has been declared
Only within the class where it has been declared
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is the value of a global variable accessible?
Only within the function where it has been declared
Only within the class where it has been declared
Throughout the entire program
Only within the sub-program where it has been declared
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the impact of errors in code on global variables?
No impact
The value of the global variable is lost
The value of the global variable can be accidentally changed
The global variable becomes inaccessible
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why can global variables be a major problem in real commercial programs?
They consume excessive system resources
They can cause errors in code
There may be hundreds or thousands of variables in use
They are difficult to declare and use
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a local variable?
The entire program
The sub-program where it has been declared
Only within the function where it has been declared
Only within the class where it has been declared
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where are the values of local variables held?
In the main memory
In the cache memory
In the hard disk
In the RAM
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to a local variable after the execution of its sub-program?
It is retained in RAM
It is lost
It becomes a global variable
It is moved to the cache memory
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
Year 8 - Unit 2: Small Basic Programming Terminology

Quiz
•
9th Grade
8 questions
Basics of C Quiz

Quiz
•
9th - 12th Grade
16 questions
Subroutines

Quiz
•
9th - 11th Grade
10 questions
TLE Q3 M5

Quiz
•
9th - 12th Grade
10 questions
Strings & Integers

Quiz
•
6th - 9th Grade
15 questions
1.2.3 - Introduction to programming

Quiz
•
3rd - 9th Grade
14 questions
GCSE Computing - Subprograms

Quiz
•
9th - 10th Grade
11 questions
J277 Programming - Data Types

Quiz
•
9th - 11th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University