C – Constants

Home/C - Tutorial/C – Constants
C – Constants 2017-06-05T20:48:23+00:00


The term constant means that it does not change during the execution of program.In the language C, constant and is the data with a constant value that does not change in the program. For example, in the program “100” “3.14” “‘A'” “” Hello “” and the like, if you write data directly, and constant. Moreover, also called a literal constant. Constant expression is an expression consisting only of constants. There are four basic types of constants in C. They are:

1.Integer constants
2.Floating-point constants
3.Character constants
4.String constants

Integer and floating-point constants represent numbers. They are often referred to as numeric-type constants. The following rule applies to all numeric type constants:

  • Comma and blank spaces cannot be included within the constants.
  • Constants can be preceded by a – or + sign, if desired. If either sign does not precede the constant it is assumed to be positive.
  • The value of a constant cannot exceed specified minimum and maximum bounds. For each type of constant, these bound vary from one C compiler to another.

Prev Next