Constant: -
A fix or unchangeable value in the program is called a constant value. There are four types of constant in C language. (1)Integer constant (2) Real or Float constant (3) Character constant (d) String constant
(1) Integer constant: -
A numerical value without a decimal is called integer constant. Or A non-frictional (+,-) fix value is called integer constant. For example +225, -555, 500 etc.
(2) Real or Floating constant: -
A frictional (+,-) fix value is called real or floating constant or Numeric values that an integer as well as a decimal part are called real or floating constant. For example +25.32, -58.679, 28.321 etc.
(3) Character constant: -
A single character when it is enclosed in single quotes is called character constant. For example ‘a’, ‘1’, ‘M’ etc.
(4) String constant: -
The combinations of characters when those are enclosed in double quotes are called string constant. For example “Pakistan”, “Phone-0966” etc.
Posted by: Wasim Javed
No comments:
Post a Comment