Saturday 15 December 2018

Types of Constant in C


Types of Constant in C

It is an identifier whose value can not be changed at the execution time of program. In general constant can be used to represent as fixed values in a C program. Constants are classified into following types.
If any single character (alphabet or numeric or special symbol) is enclosed between single cotes ' ' known as single character constant.

If set of characters are enclosed between double cotes " " known as string character constant.

Declare constant

const keyword are used for declare a constant.

Syntax

const int weight = 90;



No comments:

Post a Comment