C Programming3
C Programming3
C Programming3
else
ade 'c''.
3.
gole 'B:
3.
tolal = roo[o]+-
roasIJ+mads1;
3.
s . cathe ice oot O facn; ox
Dala
om.Accsible Pavate;
chs Notoscic,on able and Rivetclage
di0;
sbloy var 3
cote() inbut void
-fivate:
date class
Ex>
Jemction, mevbey 3;
dat merbe
unction; member Putlic:
Aivate.:
nme Clags Clags Synda:
3.
0;
bspby ob
qobondl
tt Cat
)
p-o23
dael)
doy =1; henh-1: yeoy= 1999;
3
e(ndx) on doy is sheujed.
2
doy=x; month=1; yer= 999 ';
date (it , inty, int z) //dey mqh yor
doy= ; manth=y; yer-23
3
USCONOmc);
Eombe: coss sting i
Aivote:
Prblic :
ICaqStucor.
nt lengh =stdan ;
3tr= neo chot (Jngth +1);
Shoy (st,8);
sting ()
ldstcta
The Gonst Reya- AAconstot is om entity
cohte yake dos mt ctonge
dot ng the execulen a pogom. This às cs eh!
Temom he Some Ín a frogWm.
The keyud const con e odded to
on cbjeo to note tet the declra
ath a-thon o obiccta cnsent
vatdabdle,
3;
diglay: :(nte,int bd, ird hil;
oylint
frdin Oeshaing
Fncton dnding:-ohor ton cags cmd chjed
Ciented pogomning, orag
is used to delne a set o Joncdin hot aYe gven
At the same mome nd hxlam basically the Same.
ohexationg, bt sse. dJaot rgumeyt Jia.
yoid diplo 0;
Void dispoy (Cnst chu);
oid isplo (int one,jndt ta)
Void displäy oot Tuer):
Aamige:- The moin aoondoge ol uaing nctin
ONbaing.
"Eliminates the yse c Wyesat demeon momc8 r
he omc cpatn.
Helps to undessdand ond debug cone eagily.
Maindoing Code in eg.
Ove loamg ah yovicas cao tys he combiler
diztnguish botien
oedoded Junctisong aih he. some Turmbey c ogemnt
ozided, oidd heix tye is diyeed.
Bt lncian Cesbadmg. he ogommes lide js
imbiled, aa ite nce it recS the nende
t ymcden Tomed to anemed.
int 2quore (nt
oat sque|oat);
kle sgmef doubd
Ovslintonisqure
ng (it);
a84= q0ac(a).
ercin
ovsboirg
unctog coith heSome Torne wshidh dije ony
he tyo o agements ond Torba c rgumendy.
The overloairg medonigm is oebtobe cony Gitin
keosnes argmata: -
arguntnt e b Yalue, re alkd oncton
1oviably he sme ttes as the
arends Cnd the coi the agumer s Nalue 0nto t.
fasgorngy releomcs lo ncig:- Arelexrce aidles on
oiog.
ome ron chyae. by JPx the mat inorard
mo'n()
yebn tum);
Yatd maln ()
3
Trne. Jencn- malemgdaon hidng con eat
yein
he dale n acijecs.
ol the cslyo he mcop. ause the }omt code
to te excaded.
n rine uncton is tn jut ik a nom
-Ghas
ncl o de<cooh
clhss codde stngt>
ncla
nt Tum,j.
stochs(te, ")
Vaid
feasorn
soy(coxc)
etes )s'omendl
cut<
3. Poamdd jg"ettkColeg
3
-,l=, >, t= Com ho
verloaded to gine aoditional choxtiong or wsey - denal
*yes, 89h o3 chæs, heator obading am te dne
pogom beo)
he unoy chesag, uch as the
JNAENet 4H) and deament obaators(--), con be oyecan
he fegom wl te ed to coWat a stmg
with
wth om yaotocd
clsatertt.
SmY Chedoa; - Binay ohcxtors con aso be
orotos. Bao4 operabg wk th to oonds.
n an cedoatd binay chxotoxs
mction ahe
tunctin a, erg the aigument.
mcade Conio.h
'mcudez 9tringt
closs con vetr
Pivode:
Choy st [8];
Pubic :
3
(r)t
55
chscx ()
Convexte SI=
Convet s2= Weloomc?;
=
Conyeste S3
nt
Cot "+tSi)
Stsplat03.
- S2'
S2- dispby0S
S3-rpb)- SI++',
Inheagttance.
Single Snheacilnce:- Laming om ie-oietd
cance tginriy
caes Jn dhject
js ononey bosegal yatuçe. called inthedtonce.
F cankle:- Jet us congidex afogomivg hich coe
dealng coith þeoble, emboyd Jn an
cleyt, etc.
* Nome
Enp. IJ
Sabuy satae
Engyes
Secyetat
Parvgey
Chys Enbbyee and its sabclagses
chyses rom
Desiyed Clays i Dei yaften con hee
Bsge cla and
Sab Clayg
irge Ihteeiknce
2 Madiple
rniegidance: -when asbeay inheilaee
rom multiþle se cla_ss, +
3. Hiaoha) Orteasae:- When mny obclass nbot
n a singde nse chs,
it is Xhoon as tiesacionl inhoidam.
X
Sub
cases
Hieraydigal Srhedanie
4 Meldiv ohince The tnive lre t
this yeom Jhoitanceinheitmee
Jyom a class tet iself cshen a ubclsgi rht
Jhits om ornYte
Pose cass
4-Seb Clay
Bose clas8 Z
fuyte:
Chos me. [26]
int olno,
Cho
gm;
vaid disba ();
yold qemyo();
icde
chas cose_Tome[25];
int semesex;
chor qxle[3];
yd gdinloto i
yold dapog);
Ch skudend schabsti: public þen-bo, bublic
aonnie
Vaid gei0;.
Caut ee"mNome:"
Cn >>rome;
Þn>> oln0:
3 on>>gn;
Yod pson. cua::
Cocde< romee 1 .
3
Couteu gade<< nd
aademics ::gie
Ch\n nant ecehed n f?
iis, dispyo;
ndonatecend;
Vold in)
"Plese
2o;