A constant is a quantity that doesn’t change in a program. This quantity can be stored at a location in the memory of the computer. ‘C’ constant can be divided into two major categories :
PRIMARY CONSTANT
Important Points for defining integer Constant
· An integer constant must have at least one digit.
· An integer must not have a decimal point.
· An integer should be either positive or negative.
· An integer constant does not allow any commas or blanks.
· An integer constant allows within range from - 32768 to + 32767.
Important
point for defining Real Constants
·
A
real constant must have at least one digit.
·
A
real constant have a decimal point.
·
A
real constant should be either positive or negative.
·
Default
sign is positive.
·
A
real constant does allow any commas and blanks.
Important
point for defining Character Constants
·
The
character constant is either a single alphabet, digit or a single inverted
commas. For example ‘A’ is not.
·
The
maximum length of a character constant can be 1 character.
0 comments:
Post a Comment