Constants in C++ Language

Constants in C++ Language:

(1) In C++ Language, Constants means read-only variables.

(2) Syntax of CONSTANT variable:

const double myDouble = 10.5;

(3) Example as shown:

Constants in C++

(4) As per the above image, the system shows an error while “Build” the written code for execution because in Constant variable case, you cannot assign another value.

Constants in C++ code error

Continue Statement in C Language
Break Statement in C language
Assignment Operators in C Language
ARRAY in C Language
How to Fix 24 Hours or Military Time in BC D365
Format Property– Microsoft Docs

Leave a Reply