Q4: Classify constants in C and give one example of each. OR Classify constant used in C programming with two examples of each.


A4: Constants means fixed value, the value of the constant cannot change during the execution of the program.

 

There are mainly two types of constant:

1.      Numeric Constant

a.      Integer Constant e.g. 12, 15.

b.      Real Constant e.g. 3.14, 2.4.

2.      Character Constant

a.      Single Character Constant e.g. ‘A’, ‘B’.

b.      String Constant e.g. “Hello”, “Jonas”.

Post a Comment

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