Variables
In this section, we’ll dive into variables in C. A variable is a storage container for data that is capable of holding different values that may change or update as programs execute. Your program can read the contents of a variable, update the contents of a variable, and display the value of a variable on the screen. Computer programs can use variables in order to remember useful information that the programs can then use later in the code.
-
Lecture
-
Shorts
-
Notes
-
Thought Questions
- Why do we need variables?
- What would happen to our programs if we couldn’t use variables?
- Specifically, how would we write a program that adds two numbers together if we didn’t have access to variables?