Computer Science, asked by hahsjwjjajwjanam, 2 months ago

What is a constant? Mention different types of C++ constants.​

Answers

Answered by Anonymous
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 AkariOzora
14

{ \boxed{ \huge \sf \red{Question}}}

What is a constant? Mention different types of C++ constants?

{ \boxed{ \huge \sf \red{Answer}}}

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