
Local and Global Variable Quiz
Authored by K Astley
Computers
10th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is a local variable declared?
Inside a function
Outside a function
In the definition of function parameters
In a global scope
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When is a local variable created and lost?
Created at program end and lost at program start
Created when the function terminates and lost when the function starts execution
Created when the function starts execution and lost when the function terminates
Created at program start and lost at program end
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where are global variables stored?
In a separate memory space
In a random location in memory
In a fixed location decided by the compiler
On the stack
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a global variable?
Inside a function
Anywhere within the program
In the definition of function parameters
In a local scope
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the advantage of using global variables?
Limited scope
Accessible from all functions
Data sharing is not possible
Limited memory usage
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the disadvantage of using local variables?
Unpredictable results in multi-tasking environments
Tricky debugging process
Common data sharing between modules
Limited scope
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When is a global variable created and lost?
Created when the function terminates and lost when the function starts execution
Created when the function starts execution and lost when the function terminates
Created at program start and lost at program end
Created at program end and lost at program start
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Microsoft MDM & Apps
Quiz
•
10th Grade
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
10 questions
Simulasi Digital
Quiz
•
10th Grade
10 questions
Sistem Komputer
Quiz
•
10th - 11th Grade
10 questions
If-Statements
Quiz
•
9th - 12th Grade
9 questions
Test Excel
Quiz
•
10th - 12th Grade
8 questions
Overview of IT
Quiz
•
6th Grade - University
13 questions
Kuis Informatika
Quiz
•
10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade