What is Variable? Definition, Meaning & Example
A named container that stores a value that can change during program execution.
TL;DR: A named container that stores a value that can change during program execution.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Variable: A named container that stores a value that can change during program execution.
Explanation
Variables hold data that programs manipulate. Variables have names and data types like integer, string, or boolean. Variables can be reassigned different values. Proper variable naming improves code readability. Global variables are accessible everywhere, local variables only within specific scope. Variable scope is important for organizing code.
Example
In a program, age = 15 creates a variable age storing the value 15.
Frequently Asked Questions
What is a variable?
A variable is a named container that stores a value that can be used and changed in a program.
Why is variable naming important?
Clear variable names make code more readable and maintainable.
More Computer Terms
🤖 Stuck on any of these? Ask Syllab's free AI Tutor to explain step by step →