What is the difference between local and global variables?

Local variables are defined within a subroutine. Their scope/visibility ends when the cursor leaves the subroutine.
Global variables on the other hand are variables that exist outside of all the subroutines and functions, and are available to all of them.

CD
Answered by Chris D. Computing tutor

8508 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Discuss the differences between operating systems designed for desktop computers and embedded systems.


What is the range of denary numbers that can be represented using 8-bit two’s complement binary integers?


What are higher order functions in functional programming? How does the 'map' function work and why is it a higher order function?


Which are the parts of a compuer?


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2026 by IXL Learning