Vari
abl
escanbedeclaredasconst
antusi
ngtheconstkey
wor
dort
he#def
inepr
epr
ocessor
di
rect
[Link]
ail
saboutthesear
egi
venasfol
l
ows.
Theconstkey
wor
d
Vari
abl
escanbedeclar
edasconstant
sbyusingthe“const
”key
wordbef
orethedat
aty
peoft
he
var
iabl
[Link]
antvar
iabl
escanbeini
ti
ali
zedonceonly
.Thedef
aul
tval
ueofconst
ant
var
iabl
esarezer
o.
Aprogr
am t
hatdemonst
rat
est
hedecl
arat
ionofconst
antv
ari
abl
esi
nCusi
ngconstkey
wor
dis
gi
venasfol
l
ows.
Exampl
e
Li
veDemo
#i
ncl
ude<st
dio.
h>
i
ntmai
n(){
consti
nta;
consti
ntb=12;
pr
int
f("
Thedef
aul
tval
ueofv
ari
abl
ea:
%d"
,a)
;
pr
int
f("
\nThev
alueofv
ari
abl
eb:
%d"
,b)
;
r
etur
n0;
Theout
putoft
heabov
epr
ogr
am i
sasf
oll
ows.
Thedef
aul
tval
ueofv
ari
abl
ea:
0
Thev
alueofv
ari
abl
eb:
12
The#def
inepr
epr
ocessordi
rect
ive
Vari
ablescanbedecl
aredasconst
ant
sbyusi
ngt
he#def
inepr
epr
ocessordi
rect
iveasi
t
decl
aresanali
asforanyval
ue.
Aprogram t
hatdemonstrat
esthedeclar
ati
onofconst
antv
ari
abl
esi
nCusi
ng#def
ine
pr
eprocessordi
rect
ivei
sgivenasfol
lows.
Exampl
e
Li
veDemo
#i
ncl
ude<st
dio.
h>
#def
inenum 25
i
ntmai
n(){
pr
int
f("
Thev
alueofnum i
s:%d"
,num)
;
r
etur
n0;
Out
put
Theout
putoft
heabov
epr
ogr
am i
sasf
oll
ows.
Thev
alueofnum i
s:25