What are Symbolic Constants in C Programming?

A symbolic constant is a name given to some numeric constant, or a character constant or string constant, or any other constants.

Symbolic constant names are also known as constant identifiers. Pre-processor directive #define is used for defining symbolic constants.

Syntax for Creating Symbolic Constants


#define   symbolic_constant_name   value_of_the_constant

Symbolic Constants Examples


#define PI 3.141592
#define GOLDENRATIO 1.6
#define MAX 500

Here PI, GOLDENRATIO, SIZE are symbolic constants.

Note: symbolic constants names are written in uppercase by convention, but it is not required.