Sunday, December 6, 2009

1.11 SYMBOLIC CONSTANTS

A symbolic constant is a name that substitutes for a sequence of characters.Their character may represent a numeric constant,a character constant or a string constant.

A symbolic constant is defined by writing

#define name text

where name represents a symbolic name and text represents the sequence of characters that is associated with the symbolic name.Note that text does not end with a semicolon.The #define feature is used to define symbolic constants.

e.g
#define PI 3.141593

area=PI*radius*radius;

No comments:

Post a Comment