What is a constant? Mention different types of C++ constants.
Answers
Answered by
1
Explanation:
Constants refer to fixed values that the program may not alter and they are called literals. Constants can be of any of the basic data types and can be divided into Integer Numerals, Floating-Point Numerals, Characters, Strings and Boolean Values.
Answered by
14
What is a constant? Mention different types of C++ constants?
A constant is a value that should not be altered by the program during normal execution, i.e., the value is constant.This is contrasted with a variable, which is an identifier with a value that can be changed during normal execution, i.e., the value is variable.
Different types of constant are:-
- Floating-point Literals
- Boolean Literals
- Character Literals
- String Literals
- Defining Constants
- The const Keyword
Similar questions