What is the meaning of constant variables?

1 answer

Answer

1127978

2026-03-04 00:00

+ Follow

Constant variables are variables that, once initialized, do not change in value. They are effectively the same as literal constants, except that you can use symbolic names to make it easier to understand the meaning of the program.

For instance, in a trigonometry program, it is easier to use the identifier PI than it is to use the literal 3.1415926535897932. Also, if you have a constant that might be adjustable, such as a factor in an equation, naming it allows you to change its value by changing only one line of code, rather than seeking out all of the lines of code that refer to the factor.

Constant variables are also candidates for being placed in read-only memory, potentially making the program more secure.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.