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

8504 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Convert the base-10 number 74 into an 8-bit binary number


Write pseudocode for the linear search algorithm, and then explain it’s complexity using big-O notation


Image a graph. In which instances is it more appropriate to use an adjacency list instead of an adjacency matrix?


Explain how the even parity system works when transmitting ASCII codes. Include a description of the roles of the sending device and the receiving device during transmission.


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