For factoMa
Not ACCpRg PAacer o Ct etuDiDg e
cephing paramekr
#incluclcstdlo. h
#ancludeeshdio h>
Void fact ot); vodhVoidfact),
Voicd maiNC ) void mainc)
int actC
Pnntteptet value)Hi
Scanf("zd.)}' void factc)
tactca
int -5,i,f-1)
voicd fact(iot) os Li= 1iL=h;ítt)
.'to
,nt 5,?, F-i; 4-4xi
tostits =rs)74¬)
dackonal= zd), fJS
prm (
pm dttonal=zd",f); Aepto9ane etuspipg va liet
HnclucleL Stelioh>
Rutunii ot fact cirnt)
#includestdin hy void mainC )
fot Aoct C
void malnC)
pormt(an OVaue ");
Stan"d', 8n))
factC) z factcn),
fafntt("facturmal- %d", *);
PprinCfactongl-zd.J:'
tfactt) int Ace to)
foli,lL>)) i ++)
ffxi t4xis
tettuunE)
retuun CF)
, function acceptng Ond retunig values
Based on
bto fbfaoing
& claitied
a user defined function
ou types. retun valuas
Furclon wittut parameers and without
retuin values
netun
Functon oittout patamele ard wth
retuun value
with pararneles anc othouut
ift Functon with netuun vaue
Funckim with paamejer
and
V
use detined furcbirs
hrte c pmgramto ote, the
rettun
and witout
Functn uwthouet pauameles
a
Value:
ircudisidio.hy
vofd sumé)
Oid oairt)
void Sumc )
nt aao, 4-30, z
=ty
prmH ( sum zd, z);
, uwtholt eAN' Vek uwth ettuiNiq vA'Ue
vaue
b Functton fth paramEer mcl d. FunctioD Oth parametz and
#hncludeLstdiah> trcludcsBdio. hy
oid sumlint,int) m irt sumcit,int)
void maint ) yotd malne)it
int20.-30 int aao, b=3o,
SLum(,);
pmntf("sum d , c
void sum inta, intb) l
insumlota, int b)
int C
C=atb . nt
prtsum=zd".cJ
retunC*;
CFuckm uwithut peuameler and wib tetuan values to fmd he fectanal of a
laoite a prog3amme
gfiven umber usmqFuetons.
ludeistdto h:
nt sumC );
vod mainc ParameC fasing MechaiS)
poyameer,
functon will accept the
int a from
= SUumC ; accepted paamelers to ae be paxsed
the
piF (sum=zdz to called function
cauirq funchion
are of tuo types.
Ke accepkdg garamekis
in Sumi)
Call by value
ot 20, y=30, itCall by Reference.
Call by valu
tetuuna);
Not ACCpRg PAacer o Ct etuDiDg e
cephing paramekr
#incluclcstdlo. h
#ancludeeshdio h>
Void fact ot); vodhVoidfact),
Voicd maiNC ) void mainc)
int actC
Pnntteptet value)Hi
Scanf("zd.)}' void factc)
tactca
int -5,i,f-1)
voicd fact(iot) os Li= 1iL=h;ítt)
.'to
,nt 5,?, F-i; 4-4xi
tostits =rs)74¬)
dackonal= zd), fJS
prm (
pm dttonal=zd",f); Aepto9ane etuspipg va liet
HnclucleL Stelioh>
Rutunii ot fact cirnt)
#includestdin hy void mainC )
fot Aoct C
void malnC)
pormt(an OVaue ");
Stan"d', 8n))
factC) z factcn),
fafntt("facturmal- %d", *);
PprinCfactongl-zd.J:'
tfactt) int Ace to)
foli,lL>)) i ++)
ffxi t4xis
tettuunE)
retuun CF)
, function acceptng Ond retunig values
Based on
bto fbfaoing
& claitied
a user defined function
ou types. retun valuas
Furclon wittut parameers and without
retuin values
netun
Functon oittout patamele ard wth
retuun value
with pararneles anc othouut
ift Functon with netuun vaue
Funckim with paamejer
and
V
use detined furcbirs
hrte c pmgramto ote, the
rettun
and witout
Functn uwthouet pauameles
a
Value:
ircudisidio.hy
vofd sumé)
Oid oairt)
void Sumc )
nt aao, 4-30, z
=ty
prmH ( sum zd, z);
, uwtholt eAN' Vek uwth ettuiNiq vA'Ue
vaue
b Functton fth paramEer mcl d. FunctioD Oth parametz and
#hncludeLstdiah> trcludcsBdio. hy
oid sumlint,int) m irt sumcit,int)
void maint ) yotd malne)it
int20.-30 int aao, b=3o,
SLum(,);
pmntf("sum d , c
void sum inta, intb) l
insumlota, int b)
int C
C=atb . nt
prtsum=zd".cJ
retunC*;
CFuckm uwithut peuameler and wib tetuan values to fmd he fectanal of a
laoite a prog3amme
gfiven umber usmqFuetons.
ludeistdto h:
nt sumC );
vod mainc ParameC fasing MechaiS)
poyameer,
functon will accept the
int a from
= SUumC ; accepted paamelers to ae be paxsed
the
piF (sum=zdz to called function
cauirq funchion
are of tuo types.
Ke accepkdg garamekis
in Sumi)
Call by value
ot 20, y=30, itCall by Reference.
Call by valu
tetuuna);