Computer Science, asked by mahima23102004, 1 year ago

what is mean by local variable and global variable?

Answers

Answered by amankumaraman11
3

Global variables are declared outside any function, and they can be accessed (or used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.

Answered by patrasuchismita79
0

Global variable

A variable which is declared inside a class but outside any method is called global variable.

Local variable

A variable which is declared inside a method is called local variable.

Please mark my answer brainliest.

Similar questions