CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Which Is the Right Way To Declare Constant in C?


Open in App
Solution

Answer:

Variables can be declared as constants by using the “const” keyword before the data type of the variable. The constant variables can be initialized once only. The default value of constant variables are zero.

The correct way to declare a constant in C programming is:

const datatype variable = value.

For example: const int var = 5.


flag
Suggest Corrections
thumbs-up
1
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Variables and expressions
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon