answersLogoWhite

0


Best Answer

Local variable is a variable having local scope. Local variable has higher priority than global priority.

User Avatar

Wiki User

2014-11-21 13:12:54
This answer is:
User Avatar
Study guides
📓
See all Study Guides
✍️
Create a Study Guide
4.25
12 Reviews

Add your answer:

Earn +20 pts
Q: What is a local variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is a global variable a non-local variable?

True, a variable cannot be both global and local. But if a global and a local variable share the same name, the local one will hide the global.


What is a local variable and What statements are able to access a local variable?

A local variable is a variable that can only be called on by the module. Where as a global variable can be called upon by any module. Only statements made inside the same module can call on a local variable.


Where are the local variable stored in c?

Where are the local variable stored in c?


What is the difference between a static variable a global variable and a local variable?

A static variable is a variable allocated in static storage. A local variable is a variable declared inside a function. A global variable is a variable declared outside of any class or function. Note that local variables and global variables can both be allocated in static storage.


What is local variable?

they are variable that has a lifetime within that block


How are the automatic variable also known as?

local variable


How you can declare local variable?

variable exit within a function and curly braces is local variable int main() { int x; }


What is the difference between auto variable and local variable?

They are the same.


How can you declare global and local variable in pseudocode?

A local variable is a variable declared inside a construct, such as a class or function, while a global variable is a variable declared outside of any construct.


What is local and gobal variable in c?

When a variable is declared inside the function/ main functions, the variable is called a local variable. On the other hand, when a variable is declared outside of the function/main function, the variable is called a global variable. For Example: #include int a; int main() { int c; return 0; } On the above program "int c" is a local variable & "int a" is a global variable.


What happens to the value of a local variable when the module in which the variable is declared completes execution and control is passed to a different module?

The local variable goes away and the value is lost.


What is the difference between local and global variable of C language?

4m Sai. Gloabal Variable is variable which is declared before main (). int a=10; main() { } here a is a global variable. where ever u r using this variable ... we'll get the value as 10. Local Variable is a variable which is declared inside the main(). int a=10; main() { int a=5; ........ ....... } here a=5 is a local variable and a=10 is called as global variable. then if u want to get a value... printf("%d",a); then result 'll be a=5; B'cos compiler gives main preference to local variables.. if any local declareation is not there then it 'll prefer global variable.

People also asked