Saturday, June 20, 2020

Constant in C

Constants are those data item whose value will not change at the time of program execution.
Basically there are four type of constant such as:

  1. Character Constant
  2. Character constants are alphabets.The length of character may be one or than one. Write all Characters are inside the single quote. example: 'a', 'az'
  3. String Constant
  4. String constants are group of one or more characters. Write all string constant inside double quote (" "). Example:("a"), ("Shailu").
  5. Integer Constant
  6. Integer constant represent the integer numbers , which combination of numbers between 0 to 9.
  7. Floating Point Constant
  8. Floating point constant represent the floating numbers such as decimal numbers (2.33 , 44.56).
Special constant
Special constants are Symbolic constant. It is represented by any symbol or a name. It must define before use it , so for defining Define keyword is used. Example: #define AB6.33D

No comments:

Post a Comment