What is a constant in C ?


The constants in C are the read-only variables whose values cannot be modified once they are declared in the C program. The type of constant can be an integer constant, a floating pointer constant, a string constant, or a character constant. In C language, the const keyword is used to define the constants.

In this article, we will discuss about the constants in C programming, ways to define constants in C, types of constants in C, their properties and the difference between literals and constants. 

Types of Constants in C


The type of the constant is the same as the data type of the variables. Following is the list of the types of constants

  • Integer Constant
  • Character Constant
  • Floating Point Constant
  • Double Precision Floating Point Constant
  • Array Constant
  • Structure Constant


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.