PRO
Mārtiņš
asked

Expert
Abhay Jajodia answered
Hi Mārtiņš,
Variables are called temporary because they only exist while the program is running. They're used to store values in memory that your program needs at that moment — like numbers, strings, or results from calculations.
Here’s a simple example:
int main() {
int score = 0;
score += 10;
printf("Current Score: %d\n", score);
return 0;
}
In this code, the variable score holds a value temporarily. Once the program finishes running, the data stored in score is gone — unless you explicitly save it somewhere, like a file or database.
So to sum up: variables help your program work with data during execution, but they don't keep that data permanently.
If you have more questions, I’m here to help.
C
This question was asked as part of the Learn C Programming course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
