4.1.1.6 Constants and variables in a programming language Flashcards
1
Q
What is meant by a variable?
A
A name in memory with an identifier that stores a value which can be changed during the program.
2
Q
What is a constant?
A
A value defined at the start that can’t be changed during execution of the program.
3
Q
What’s the advantage of using constants?
A
It improves the readability of code and makes the code easier to update as only the declaration of the constant at the start needs changing. This reduces errors and makes debugging easier.