Which is the right way to declare constant in C?
a,int constant var=10;
b,int const var=10;
c,conts int var=10;
d,b & c both
Answers
Answered by
4
option a.
int constant var=10
is the right way to declare a constant in c
c is a case sensitive programming
while declaring a constant or a variable we must keep following things in mind
in c
POOR and poor are two different variables.
POOR is in caps lock
and poor is in simple writing.
hence cannot be equal inc
Answered by
6
The correct way to declared the constant in c programming is given below
const int var=10;
Explanation:
- Constant are those which value do not change during the execution of the program.it means there value will be same throughout the execution of the program.To declared any constant we used the following syntax
const datatype variable = value ;
- So to declared the constant we used const int var=10; is the correct way to declared the constant in the c programming language .
Learn More:
- brainly.in/question/6841239
Similar questions
Math,
7 months ago
Social Sciences,
7 months ago
English,
7 months ago
Economy,
1 year ago
Physics,
1 year ago