Thursday, September 3, 2009

CONSTANTS IN C

C constants can be divided into two major categories:
1.Primary Constants
2.Secondary Constants
Primary Constants include Integer Constant,Real Constant,Character Constant
Secondary Constants include Array,Pointer,Structure, Union ,Enum,etc.

Integer Constant:

An integer constant must have at least one digit.
It must not have a decimal point.
It can be either positive or negative.
If no sign precedes an integer constant it is assumed to be positive.
No commas or blanks are allowed within an integer constant.
The allowable range for integer constants is -32768 to 32767.

Rules for Constructing Real Constants

A real constant must have at least one digit.
It must have a decimal point.
It could be either positive or negative.
Default sign is positive.
No commas or blanks are allowed within a real constant.
Ex.: +325.34
426.0
-32.76
-48.5792

No comments:

Post a Comment

 
GetBlogs Blog Directory BrowseBlogs.com Subscribe to updates