Local and Global Variable Quiz

Local and Global Variable Quiz

10th Grade

9 Qs

quiz-placeholder

Similar activities

RAM, ROM, Virtual Memory

RAM, ROM, Virtual Memory

9th - 11th Grade

12 Qs

Python Review - Functions

Python Review - Functions

9th - 12th Grade

10 Qs

ICT General Knowledge Quiz

ICT General Knowledge Quiz

3rd Grade - Professional Development

10 Qs

integrasi aplikasi office

integrasi aplikasi office

10th Grade

11 Qs

Understanding RAM and ROM Memory

Understanding RAM and ROM Memory

9th Grade - University

11 Qs

AP CSP Unit 5 Chap 1

AP CSP Unit 5 Chap 1

10th - 12th Grade

7 Qs

Checkpoint 1 revision

Checkpoint 1 revision

9th - 12th Grade

9 Qs

2.3 Producing Robust Programs

2.3 Producing Robust Programs

10th - 11th Grade

14 Qs

Local and Global Variable Quiz

Local and Global Variable Quiz

Assessment

Quiz

Computers

10th Grade

Medium

Created by

K Astley

Used 3+ times

FREE Resource

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

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the disadvantage of using global variables?

Unpredictable results in multi-tasking environments

Limited scope

Data can be modified by any function

Limited memory usage

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the advantage of using local variables?

Unpredictable results in multi-tasking environments

Guarantee that the values will only be edited by the intended function

Accessible from all functions

Data sharing is possible