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

8494 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Simplify the boolean expression ¬(A.B)+A.


One member of a chess club sends a text file saved in Unicode. What meant by the term "Unicode" and why might this be necessary?


Explain what is meant by the term ‘TCP/IP stack’ [3]


The numbers 6B and 12 are displayed in hexadecimal form. Convert them into binary form and perform binary addition to find the sum. Convert your answer back into hexadecimal. Show your workings.


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