Constants and Variables
As its name implies, a constant is a value that never changes. A variable, on the other hand, can be used to present different values.
You can think of a constant as a music CD-ROM; the music saved in the CD-ROM is never changed. A variable is more like an audio cassette: You can always update the contents of the cassette by simply overwriting the old songs with new ones.
You can see many examples in which constants and variables are in the same statement. For instance, consider the following:
i = 1;
where the symbol 1 is a constant because it always has the same value (1), and the symbol i is assigned the constant 1. In other words, i contains the value of 1 after the statement is executed. Later, if there is another statement,
i = 10;
after it is executed, i is assigned the value of 10. Because i can contain different values, it’s called a variable in the C language.
