What is the difference between the local variable and global variable in C?

Following are the differences between a local variable and global variable:

Basis for comparisonLocal variableGlobal variable
DeclarationA variable which is declared inside function or block is known as a local variable.A variable which is declared outside function or block is known as a global variable.
ScopeThe scope of a variable is available within a function in which they are declared.The scope of a variable is available throughout the program.
AccessVariables can be accessed only by those statements inside a function in which they are declared.Any statement in the entire program can access variables.
LifeLife of a variable is created when the function block is entered and destroyed on its exit.Life of a variable exists until the program is executing.
StorageVariables are stored in a stack unless specified.The compiler decides the storage location of a variable.