Local variables are declared inside a block or function but global variables are declared outside the block or function to be accessed globally.
Local Variables
Global Variables