Symbolic Constants in 'C'
Symbolic Constants in C
In ‘C’ programming there are some constant which are important in the programme. These constant can be made more clear by given them some proper name such constant are called as symbolic constant and they appear in #define statements.
#define is called a preprocessor directive in ‘C’
For eg:-
#define RADIUS 10
#define MARKS 100
#define TOTAL 500
#define COLLEGE “
#define HEIGHT 3.7
Rules to define symbolic Constants:-
- The preprocessor directive #define must appear before the symbolic constants.
- No space is allowed between # and define
- After the word #define a gap is necessary before the symbolic constant.
- After writing the constant a gap is necessary before the assigned value.
- These constants are written in upper case form.
- #define statement should not end with a semicolon.
0 comments:
Post a Comment