Computer Science, asked by varnika71, 1 month ago

write the examples of local and global variables?​

Answers

Answered by navya2642005
3

Answer:

Local variable is declared inside a function whereas Global variable is declared outside the function. Local variables are created when the function has started execution and is lost when the function terminates, on the other hand, Global variable is created as execution starts and is lost when the program ends.

Answered by llNidhill
3

 \huge \tt \color{magenta}{Ⱥղʂաҽɾ}

  • Local variable is declared inside a function whereas Global variable is declared outside the function. Local variables are created when the function has started execution and is lost when the function terminates, on the other hand, Global variable is created as execution starts and is lost when the program ends.
Similar questions