What is the difference between Local Variable and Global Variable

Local VariableGlobal Variable
Can be accessible within a part of programCan be accessible anywhere within a program
Declared within a function or blockDeclared at top level segment of program
Its lifetime is function’s runtimeIts lifetime is entire program runtime
error: Content is protected !!