Structured Programming and Subroutines (AQA GCSE Computer Science): Quizzes

📚Quizzes
Local Variables
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

11 questions from this quiz

Show

Where are local variables created and used?

Inside a subroutine

What does local scope mean for a variable?

Only exists in its subroutine

When is a local variable created?

When the subroutine starts

When is a local variable destroyed?

When subroutine finishes

Can the main program access local variables?

No, it cannot see them

What error occurs when accessing a local variable outside its subroutine?

name not defined error

How do local variables help with code organisation?

Variables only used where needed

How do local variables provide memory efficiency?

Auto-cleaned when subroutine ends

How do local variables enable code reusability?

Same names in different subroutines

How should you pass data into a subroutine?

Use parameters

What does 'scope' refer to in programming?

Where a variable can be accessed

Join 100,000+ GCSE students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.