Programming Concepts
Check your understanding - Constants
Which of the following statements about constants is FALSE?
The convention is to write the name of constants in UPPERCASE
TRUE. Although for most languages it is a convention rather than part of the language syntax.
Constants can't be changed in the normal execution of a program
TRUE. In some programming languages there are constants that are predefined and can't be changed at any time. In most languages you can identify your own constants that have a value that is fixed by you.
Constants contain only text
FALSE. Any type of data can be made a constant. How that is done is language dependent.
Constants can have any name
TRUE. Although the same rules apply as for variable names, for example no spaces or special characters.
You can mix constants and variables in program statements.
TRUE. Although the usual data matching rules will apply - you wouldn't be able to multiply an integer variable by a constant containing characters.
← Previous
1
2
3
4
5
6
7
8
9
10
11
12
Next →