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

8068 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

What is the difference between a variable and an identifier?


What is the difference between a high level language and a low level language?


What is the difference between HTML, CSS and JavaScript


Show how the decimal number -183 would be represented as an 8-bit two's complement arithmetic


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:

© 2025 by IXL Learning