Differentiate between global variables and local variables. Also give a suitable
example to support your answer.
Answers
Answered by
0
Local Variable
1.Declaration : Variables are declared inside a function
2.Scope: Within a function, inside which they are declared
3.Access: Accessed only by the statements, inside a function in which they are declared
Global Variable
1.Declaration :Variables are declared outside any function
2.Scope: Throughout the program
3.Access:Accessed by any statement in the entire program.
Answered by
0
Hope it helps u dear.
Attachments:
Similar questions