Q5: Explain symbolic constant with rules for defining symbolic constant and example.

A5:

A symbolic constant is a user-defined identifier that represents a constant value in our program. Symbolic constants are defined using the ‘#define’.

 

Rules for defining symbolic constant:

 

Use #define: To define it we use the #define pre-processor directive.

Name Convention: It is written in uppercase.

No Data Type: It does not have data type.

No Semicolon: It does not end with a semicolon.

 

e.g. #define PI 3.14

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.