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

8843 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Why would you use Assembly Language instead of a normal programming language?


What are the benefits of using thin clients.


How do you convert from binary to decimal?


Convert the hexadecimal '3E', which represents a 2's compliment binary number, in decimal.


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