
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
analisis data dan visualisasi data
Quiz
•
10th Grade
10 questions
Паскаль. Основные команды
Quiz
•
8th - 11th Grade
12 questions
AP CSP BI 4
Quiz
•
9th - 12th Grade
7 questions
IGCSE ICT - Safety and Security
Quiz
•
10th - 12th Grade
13 questions
python A
Quiz
•
10th Grade
10 questions
Perangkat Lunak Pembuat Slide Presentasi
Quiz
•
10th Grade
10 questions
Quiz Informatika
Quiz
•
10th Grade
10 questions
1.1 - System Architecture - CPU [OCR] [GCSE]
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade