Computer Science, asked by khanmusadiq1234, 2 months ago

Discuss the scope and lifetime of local and global variables

Answers

Answered by nr123456
0

Answer:

Global scope : When variable is defined outside all functions. It is then available to all the functions of the program and all the blocks program contains.

Local scope : When variable is defined inside a function or a block, then it is locally accessible within the block and hence it is a local variable.

Answered by sriswetha947
0

Explanation:

Global scope : When variable is defined outside all functions. It is then available to all the functions of the program and all the blocks program contains. Local scope : When variable is defined inside a function or a block, then it is locally accessible within the block and hence it is a local variable.

Similar questions