0 ratings0% found this document useful (0 votes) 124 views38 pagesC Programing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
“ee ctimersiorat aay:
Tio0 | Ans
ces Sra) Away is hawtg
yun Index
Fe) one epesit! “ok oldler
YEPEAEE Calurrns d
sticluck enciggs 129 Se element
PONG) £
WL atsi0394,5 5
i oo OGY cherrengiy);
“Be Gye
Onl Curd yg acisc;3),
Bi
¥
fox Gee) ies jit)
| | ;
| tu
| \ pint Cv", carps);
> y we
mint Mand}
%
¥
|
|
|
|
|
|
|
|
far Gyroy ) ea; jet)Wnts Caan yo ‘veod elemmols. ins,
= Ihe,» “Weuns;
Sxy_ cmabi, and display VO POse
of @ mot:
rAnctude esidio h>
AAMC) rth i
\ : ap nett
int aCsMadary:
Print (emer “anay tlements");
fs Meo) 1035 >
t .
For Gyo) 3235344
Oy ' dened 4 ’
SOMO”, OCIS > ne
4 2
y ;
fev Cir0y 103, 849
.
rCjov jes;
t
PANIC ATID > .
¥
pronal Cro")
y
yi
B write a cpegam to ead
Ae element PY 3x3 erat
Ard dipley the dtagna
Ckements
|
|
|
|
|
ighing tude
a ’
Tint OCsIsy 1,
pant Co ens a
Fok 05105 shy
ie
BGs s25 5655
Lt
. » sSosociays
Pinkt Cane OxeXn")s
Ee Crores ssay
=
.
WCie23)
Pink CHa", acids
ty elements");
FONE CS yp ger
frCj-054 con
4
pwott C&R;
3 ERG
8 lasle a Cyreqam A> find the Lace ofa
root Ctyace ~ sus of Ciagpnal element)
HAtlnclude |
UG ee ; oo | meuiney t
ee WICh):
i teaciga; | | wt aCt07603 4
y : . | DENEE Center nN);
, mink CUZ" 5) 3 | GONFC hd, andy
| pine£C ener Garay: cenents 7)?
Bisa Fa lize 160 yaayy
Cregrarn to read clement inte
| OO nA int Aitplay an othe dognoy
t
| fo Geos ens yay
[elerrend Chath pincpal ginal” Dyperte dicgural)
ys
BY i
pratt C sur, of dpp diag lementt is \n);
for Creo ENF ANY” :
L for (joo: JEN Ti+)
ECapd™, 400315907
_rAinctucte Colddo b> ‘ : Sa ,
rrouinc )
Ss
1 Prin U Clenter att ys
j Kook C&A", Sry;
wel Co
i
|
|
‘ 5 - |
it a C30}, 3,5,95 , |
BC isjeod)
erty anos etenonty); > | : ps0 I
for Cisos vegies) eh oe
. i send :
for Gro cyan) y Cw
ay a» Gyro sya yay i \ Tah a5
, SantCrva" ocr itis ” | 5 i
4
LIke a Cpnagramte read element) into one
Pink C etementy asedtdy ie Goa eos a
Aor Ceo ens tad po xe
ogee ths | bo even element) and replace the odd
¢ Cane iy | element — coithi-f
i ForCyossen risa) ‘| 3 | | sHinclade ettdin ke
% eS 4 | mosncy
a Crest tayen) Hast &
pnts ConA OG IGS Vy fetnv ata;
PANT Canby 07);
Sort Caan);
Peetl Caner anay element)
for Crs ten ai)
u
Scan € Crd ¥20.0))
y
Coens in) £
WlaG 7s cceye
OCF atta,
che
a
} aces yy
| PuRKE Co
for
4.
es
pdoted Gray bs \n ay
Geosiens pay” .
© print Copel”
4
%
ram);
| BH We a Chegram’ te Heod-elemely ints
KS okt and GRAY You Wife jum
adimclude , vet
mrauind >
t
mA Gok) Ay rate a
1 pant C enters. 0); : soni
Kont CY 4d", aN); !
aint! Center Gray clement) )-
dov Ciko Ven Hadi oes
ov Cyrene) rer
X
sseon© CVd 0 CIGD:
yy
dwt sd; fen pie)
TW Retien: 4
P fans jaa)
U ee
ArH AAC
| Pest Cyd ays
| > 3yRes
BA Wate Oc pogiam to rood clement into
NXO erasit and qlalate he tn of
Perctpal diagonal elements and sum of
Seem das diagoral elements seqaratly
DIPOY the Aheie diierence \
AR luce eAkdib h> ,
raund) det!
fs
vertt OF
IM CE alojloIij} Ard Yeo,
rote Clenis nt);
Sconf (47a ans
| KOE Cente anay elements!
| for Cixoy jens ash)
© age ohsenshsa)
| t Sond (x 2003/1);
| ¥ :
| fisrCisos ion 543% 5
oe eee
| For Geoaen ya)
t
Wary)
we sea C517yee SS MOT AMG It NN D)
pe Ute yH=EO-1)
chor Cizoy en
geys adi 3095 | sie)
ae ry a-yyy if ; MEO ZI aca» |
3 |
So iwwe cpecpam to read, elemints inko |?
tue nxn watcos and coluslot ie y
addin, of, wd, mepteey,. ‘ Sorc ans Sang
Teipchace of hes dae teers || Searebrg echiques
hy : is “ihe, pres of seach an
Ant, OCo fo}, PEO, ets Das
PROM CO enter 6s
| element i cated waicheg Aealvqne “there
Sank Cyd" )y Fare wo Ayyer of Searching Pchrayicy Ove
bent Center ‘ | these - qhey ae
“bY Ceo jen : se AA D Ureor seach behnque
VU Bhary search lechrqte
{ OnE Crd, RoCiICGI)} Linens search techniques
pols a f \ the pocen wearcheg AN
in Ry na : \
; Pr theese steno); } element Jimearly Uy Rawr gy Var search
a Cieo siewy wy
© by Grote
Cool Oya",
WHE a cproqvam to ‘ad clement into an
oy cured check uahetter he fey Clement U
oy RE yang evar each ebtine
availableathinclade orkeltn h>
macing )
: Ink Yeni, bh, A. ACT, bay ;
auray aterent) :
Aes Ceorien si )¢
, Sand CMa aC); a
brinkE lente kayt)y
sont Cy, s roy)
| A Cleo sien s HH)
t ;
®iF Comte yey) :
€
hy
beak) y
y
if Cxszoy
wel Cade found");
ele
PAE CO tone);
y
Binary
Seoch
chniques
Bi ble a. c pregioan to Lene the element ile
On away
for the
Hal sigue
Htrclucie < pide: he
wands
y
in Qatendyg ice ald Bach
ey dewent wing brag parc,
5 r
> Dlike linear: search ~Kchnjue
me Wwe, Nah mid,
pont Crenler aids
seanFC* Yd yan )7
© pC enter aivioy eteivend "D:
IAM) Key) ACuoL!;
Sor iso mye
5 onl’ rac;
u Kay’) 5
eleag es Mant Guat #5 i
We Clas ce Kgh)
a
tridl= Ctasahgh) /_ ;
7 Crey> amid )
Kow = mda 5 &
FF Chey e amid IE
ghz wid yy ‘
ele
mad)
Brealey yy 7
taee)
Pn tf Corot founa”) 5
ale
pin Ch fora)?
4
else
where we
key element’ linearly one by one,
took for
i Wwe FRekiced
" binary starch econQue
| she enti
Oot searches by dividing “the entire
using Peenula
Osray
fot two pers bymde
Tatially
&
search
Chighlood/2 + + a
low=o , highs o7
Consider the - following Bray ang
for “Wie Key element ag
as [ae jis «[25 [35]
tas ty ;
78 4
wid
high
dows © , high=4 :
C lowes high ‘) |
ag
fi
s 6
3
mid ©+D/,
“yu
Amid} > @ful =
key = 26
key > amid 3
mid
> lose mide!
Uap!
mid asa highh hes Gray, ©
Ltwid= +
O (mia ofa}: ac
key = afin)
hence Clemend
Keyra?
Cid) « 201)
=f
-found,
> Sorting ;
=n
“The proces of
Clements tither iN Ascending otdor
dascendirg ’ Order iS. “Seid, Lo be “the +
sorties, bie! cechaique Cured “for Sorting, {5 sows)
bec bnique.
Arrangement of
Ov
7 8g:
Babble sort
Bubble sot :
whch Compares
(and perfoims
ett &
SY “Consider the
NAG (3,6)1 And
in sorted crdley
Kechnique
at a time
0 Sortir rg
tw Clements
SWOPPIAG: AS Ted SeGubiement:
Folly elements
Onarge those elements
sing “bubble Sort
technqwe colth VQuied — Cxaraple pazpome
Compare. PLA] HOY compare oF] pee
Ofeyony LAE ¢ O891008), ' compute
ae pe Ms S vee 90.00)
ic Ace 2013 316 evi Teen
Athen» gf] | leave | Sev
“then > 1 SCOP
Lap afo3,a¢4) + fi | yeeer
fa oud at euwetela | aay > acy
‘ee UL ARNG I sowkes 7
KY a ; reptot samt 7 2 \ SBA PpNG,
Yap es Pace oan “LS “teen
wh “| compare ateseey > [E_|
7 OBleom.0 “19
eave
NAY oe TP A cacas ak
1 BHA rocyy"1 4 | alsa, Sy eo
> TI Sus 9pg | lade 7 fare iccon
afi) then a
vos} sf ate ats
“hy %, have
atratey! * reac PLA A) cacy yo
“1D hee: ‘
Ply £4) scape exe pe] Mow
ste] Ake fr ste 4
ay vfs _ af=. hence “the oder
way sored
for Gearien fy)
pyate aC pogeam “Fe reacl eberents ina,
ie? ‘i Dies Uw»
ay FS Reckeee |
bS wae |
nt AGoo} iO, CF
piotf Cremer 0°97
scant (Ad EOD; 7
anet (Renter anos elerents
ta AO? 7
0G) i. os
4
Aor Cisoijens AD . “
© par ljeosjen~i-1
Lye Coca >acyend
© coes3
acs acyey:
AGIs co o . q
y
y
ghee
poll Csovted clementy \n):
i
“PAE 7a VE", 0013) ;
; i
J
9 te OS pogiam for tmulipkeativa of
martices -
siFinctude
maint)
iu
IK 0.010.600, b Coy
. Cs), COD Cw
pint Cerkern')s 19), CO) Co}
seonf Cyd "en;
BIE Center 454 eoecbit elecrent";
for Cizo; ie
SOMO 8", « OCiIE39;
y J
pitt Center 27+ macbit Cerrentt”)?
for eosicn: i440)
Vevejeovien s 504)
OF Cina, « BOTT:
y
for Cico seni a4)
Cahn
for Gro: j ens js)
Cea ati aso,
for Cleo; Kem bere)
£
¢ cog COI CSD+ACHICE] +b CKICLIS ©
y
eras SREBR kas a & payer
fa Cheojier itt)
t ’
or Gjeorien 4D ut
z i
pinta", @ ACID?
4 Diol GENE \n") 5
o ; : :
>| Si
| Ase:
| A t0z -6s to40
ato t= G4 to 12a
ot A= Uetos? ,
special tymbols = Se (GU
eee
li MY is O Group of Characlers -
Hfincluciastring -h>
for stings
‘No! Se ~he indication of end of ‘the
sete
> Shing handling prowfanctons 6)
! sting, reanipulating Functiins te
Shelen( Str cmpi cD
slivevC > Sheok CO
Strupr cy SHCPY CD
strtar cr > SEIREMPD
slr empe > Sbracatc )
styncpyc)
sy tthe header -file wed |
Y> stlen OF
Ee ts the ae cued: “8 -finctthe
| length of “the Shing that 1S Susser of
choracters) in OQ. stoing:
ere 4
see include < stdioth>
| atincluck < string h>
maine) ' ioput :,
t Nishitho,
| choy oles); output +
| riot dy 8
| pate Centes, sting \n
Gets Co), Costar ot
= strlen Co)
Ai Grae
Sie Ong le ced “ko vereose the sbing:
| Hl aus hincludeesteio- be
include, << stiingeh ». r
japut ft
masne) Mishitha
ie 4 tpat
char oC] et
paint Center sevng\n")2 on
teCars +
i |e ai Cins% stvvevCo))
| 3
tke sting in
“the
Strupro: an is Wed to rea
lower cose jetters QKd weonverts
Soing into Capper care letters
|
{
|EEE
drincludee stdiv-h>
luce 2 string h>
PCKING Y : input
t ; nishitha
chat aleo}s sakes 2
Pantt Center sting 10"; er
Gets Cad 7 Dee
inthC* 7s") strupr Cod)!
ye
> Strler ot
=— “T+ is wed yead “the “shiegio
| Uppercase letter. @nd converts the
| stingy inte lowercose lettens-
afhinclude stdro: b> :
include sting h>
maine) ;
¢ inp
AIS HAN
Chor atel) oustpucet I:
Pint Genter sing "7" aishttha wy
Oe Ca)
paint hC zs", surfer (0) }
gl :
> strcmp orc, ig the function -ased “bo
compare “eno strings and returns Oi
both strings axe equal othewoie it
yetwns The Value of ase, ditRrence
of thelr first difference Characters
arinciude :
atirclude
Ale pws O cpregem
CHO Ob, ble); input :
int 2; ' Endo.
: it Co
11 PALE Cenk Sting") AIndgresion
ges od ; 7 outpet
PHOEL C° enter Faye gon
gu (by; 4 secdnd string D2 i Pigs
past hOAZ Cath ented
ge sticrmpCorb) neo aS
prot Crd “ay
5
‘ “ke check wohethey both
Pe shirgp ove gO! nee
pine tutors dio: h?
ayincte de ostvng h?
masnc)
eles)
preter chow ots):
int te
pet enter tr stesbirg\! VV
etsCod .
eg renter second thing \s oy]
gener?
Re trem pCa)
if C22=0)
pandt C* equa}
else
pintt (not equal");es) stempi CDI ae is tuedt “to Comnpase
. ree Steemp ©) buck
igroes ue
syst
Galy’ difference eve 18
Sensttiity Capper cones tasetcore WEG Ge Tam)
jap!
include < string: > fevers indio
maine) t kenga
t char ated, DCW) output: Co.)
char aCe}, bli)? sprint Co enka thirg \6)5 _ Remy
Wide ge yi tity, outqus: Chia)
mint? Center frst Poing\n"): pint Chante second seuingn "7 iio
ucas ; Gescpy
Taint Geder Steend.rbitg\o'}; sirepy com)?
why; ' punth Coys", OY?
Br= Steemioh): J .
PintéCurd 2): Ly sdynermpc dt ope ts used to eee
3 . Number of chooks of toth sévings-
eit’ Wed 4p
sbinclude = ttdio- b>
seinclude esbieg h>
rege’ > A inners
t indid *\o
char OC2} ble) rergoe!\0”
evel enter fick Shing \n!); outed GA)
guilay: iretia kenya
pret Ce enter Second GID output: Cao)
get CB). en yvtedsa.
streak Co,
pert£ CO’ 7s ODS
7 SCIONS rp. ts swued
a
sking inte “the fest:
include estdio h>
dinclade Singh>
Mm
4
y SS
inc)
chor OCw), blo) ,e/
partes ecte nt):
scant (eyed) F9) 2
prindf Chane Rete sing "07
geticoy:
prin fC
OuCay:
stencmplarhae
pint Chas, seenerpCa rhe
ker tecerel ing?) 7
© copy the reer
rg ~thor is -fiest
shieg, ge replaced with second sting:sea OES inalG inte resin
Tops nce Corbin) teeny th
cules g
Ta the obove ecampte the Mewtt TE
eventhough both the ings Gre 6ot
Some Renton is A=3° CONCH Compary
only Pst “three choroctes Of bath
athe sting
— strnwt oo?
on . r
TAS wed 40 jan “A” Chosccty
of second Stings to the | -fink thing
sHieclude
ctimnelude ating “A>
rraier ) .
{ input! 5
Lease Ce blo}: india
B tenga
utp:
car 8C india Ren
pant® Cerue Fist Shing’)! .
HCO): .
Pie Cert Second Ng");
gench); ‘ .
ZeSEA (eat COrb,O)2
bt, shensot Carter)!
2
printf
3
seis used to replace the
crarocts of -fitt shing
charodus of
> ecey er!
se curber of
4 “dh number of
secre ctmRG
ginctade ERAT HS
uyipelsde <#0irg ho
madnc) iepest
{anny Indio
Aw ow bte)ra: eng
qantf Cente n°); a
scant (7d "499 ani
pant Chante fit reeng Vs
Cad:
exten second SHiPg™)F
gets CBS:
storcpy (Om AY
pad Cs" shirepgCaubrd)?
3 7
Vas! Beg the length
plate O < pogam * fird 3 \ ng
ofcthe stig qakhout — NG silency
Sarcdor *
apinclude exdio b7
a esctingsh>
atindlude 5 a
ii indone sa
chor oC25)* ouctpak?
int tao: a
pint t Cente S2"9 lo):
gett fos
dow CHO) OCT Le S\0! 44)
t
de tany
g
paint red”. 2)!
5g Laite Oc program to reo. ING ey
Tamer que letters and | conver tt: “the
sting “ints capper COHe leathers» cptthous,
Eng > struprO)
weg) Pr sgavo ;
crinclude < rettig he
~Hinclude <5 ting h>
maunc)
r choy ac);
int Ve
print Centon sing"
aciJ= oC ~ :
3 ss
pine t CxS" 017 | ,
¥ HEM Ly
S sie o Cpregram to tead 30g in
“PREY OAE eke and Convert, he
i
ints leer coe Voters CeiMhoud Cay
Strluorly “ Mg
Winctude estdig hs: oo) ot
sinclude < ching -h>
Winey
t
chor
ink i
rate i
O00) }
for GO} ACL = ols
t
OCiI- OCI) rary
| y
| parle ss” acide
}to3
19 NaWike 1" c progiam “For Aisplaying sfolldting |
potter) fn
A
BB
cece
p poo
E eG
65.5
AHindlude< sdiorh>
Wi; Pantheres 59
5
y
Phin Cyan) 7
j
4,Jo
nn
ny
no D
3 fe
Like “0 C+ patton “to ead The Sb09 Centers)
Gnd Cami Sumber of Wd INO, Given
sy
chincludecstdo-h>
faioc)
cha . iopat :
atl C cate. . oukpudt -
"eGo seweg’)s Y
POPS EHOCIE NG 94)
#Catige-% ty. es
itcga’ :
ae
y
4
Win Cnds 4s
5 Fy lout
B, wwite 0 Cprogam to read the bing and
Count nuirker Of capital feMers, gout Letery
digits, Spoces, special Syrbols - 4
arincluce estdph>
train y
L
char o(30);
lk iy cio, Ceo, 9-0, sp, Leo}
print C'zntey song");
ges es:
Aor C120; DOI= *\0%; 44)
‘ iF Cots» «:
t
ct;
4
else if Cati}s.944400Je
maint)
tchar a C30;
| printf Center thing");
gers Cos:
forCiz0;acral= \077
{
ACs acrjes
a :
pant CO%5" a3
¥
A-6S Gp
B- 6G NTA
Mate
Nut
coe E793 oa UES
|) ores) T-4 p80 vt
fe-en K-35 Q~ 81 WBA
Faq L-Re Ro $i Kae
o- 9s J -lox, we
Ib tbe as -woy ator
je- aq j= ws
d- 100 J~ we
eo ye tot
fro LH Oe HY Lao
dod Ug Miasgpl ues (G-S4-) B50
Ws yey SSI SSB RSS Q-g gt
144)
“Pypamic memey aitocotion (Dm).
| Maine)
MMococing he’ memory clusing the
Yun tine
PFO program is nan ou DMA. |
malbecy
Your the inci uted for dippame
Collec CY FEPOY —_ANlocortgn «s+ 7
Kranzles wing malloc ¢) +
Addition OF too numbers Using Matiloe CF 3!
Atinclude 7
Maing)
i wnt ¥0 Cmattioc) .
Prot Center ‘
Sant Cond any
Me MANOLC cot Cink) *A;
Frnt Center away elements:SconfO1ay, DEI 6 <
Arr Cieoien ia). ;
Pint (87 a", CHD) > z
> Sum of Asay | elements wang calloce):
AWinclude
MAING) eae m4
‘ int *Pnteo 5
Print Center ny
Scant C24", Andy
Fs callor (sree Cia nds)
TTPAT Center avnay deren!
Fr Crosiens a4), : ha
seit
Ceotoces)
REO CRED shack KAD,
Pant C7g 4 4.
y
J Wrile a ¢ progfti
Sting — corthoug using
shNnclude Zstdioh>
maine)
t allie ‘
choy @(20) ,c; 7
in js
PHINUE Center name) et
ae Cod: + im wit!
3 a dle
sthrev cy
“the
!
§ While Cpagiacn
Cac;
Q09+ aj);
oCi)=e;
PIMC ES" ade |
3
| suing © str cot C)
jWincudee steio he 7
Moin)!
t
char aC}, blto):
aint *
PYIBLEC oiler Fait thing’);
ge’ @;
TALE enjer second sping'):
SORBED os
ft
oCai~b
baa;
4
OCLJ> ‘\o';
PANE C6", a);
y ;
“the
>
ie
» [ola PT
fs} should be replaced
= cath C0),
5, 45, ShilenCod
5) oC} = bli)
FeAuIt also shoutd he
Eod | with’ "Volt so,
aCe: ‘olthe 2nd. Por (iO; a(t \o's fat)
2, Witkk a pyom Copy
t
Sieg XD —the_ FF SbIng without’t
Streqyed - ; Css)
ainchde . printf Cr 7c", acia):
saint > oo, # Cate O° t
chav ote), b(i0} ao btie y wer “He”, aCr#9);
int a5 : 4
Printf Center first sting" )/ oa wig a leit gle
gers(o) j 7 f Ves Bo Write Cpregrom Moo check eegphether a
_ Print! Center second String s athe gyen string is. Palindvorne . OY 0
ame geet): ' seth 6 stiby egtinclode estdioh> :
ds strlenGb); oO)”
. maine) el i
. -to¥-Ciroy bli glee lols i+) { . i
EE USSG, re thea . char aw), bO; j
aay lili pant Center ake sing : aid 2
Btn gear oe i
O29="\0"; a a Strepy CBO); hon . %
Hiscigas <> 0 gone te eo eure C8" :
en ee eee if Cstremplarb)= = 9)
# el We tee pant? C- Patirdiorse"))
& Wat GC pegiars to Fead “the sting else ‘ iectrorme” 3
Dbbieviecion ond display its sho tforre printe C8 PO cl
Ce Trcian Rdvinichiotee, Service — TAS . 4 : 1
“Traian tiv Fowe'= CAF . / i
: pe stings + a
sHfirclude < stdio b> ae Prroy OF SOOGe en = |
MOin( pet, Proy of Stings to be wed |
5 . ;
Sa OME jaas pee | ip two ditnensoeot character Ory - |
int 5 ‘ . | Ge char AC2}C.]
pants Center the string'") | Ha the above example frst index
gets); stalks Obout Namber Of sings we Con
veod seer inden Maicates ARE movomum |
Forge of each fengea age Rae? | Crea chop Fy!
“Though hare Created 2. Wile A © picyam to Kad. ¢ cicketer
direrconad chorocier WO SUI tte | nares And display “those names’ in
= &, 19s (QeO shngD Sorting order :
Tt
x sortie 0; 1255419) fie. te Foine>
t Cee ryt t
s(aan;
i caciD; : | chow focien cess rete
p12 ro 4 9 ¥ ;
0 Teo Th Nel * . '
et Te dita aca i
> Tefolh |i A ve i
3}p [hho i [so ve
ofc re sul oe i
| flush Cstdin) j
BD Wile Oc ‘pageim “to read. “gun. . ce ng Bees COC:
names and display “these names. ; | o a8
binclude ¢ Stdio “b> SOF ake | pie
round) a ‘ 2
A Lincame eH L, : pote
a Drotitedoans toe : cya wt te 3
ones ee e f “Csbvemp CoC] AC 41.) 50),
prot? Center Singsion); + ue shepy Ces et
r Cresent ‘ | shery Cac, aga
Pfluth Cotdiny 21 PPE Po aad 5 seepyl ods cy;
: Con: | 5 4
4 “ni at : printf C “ported sbi0g1 aveint)>
Hen O75: 44) om a | refer Cte fen :
pint Cnsn dca; ot 1 © pyint eC psvt5acia) :
‘ ¥
a0 oe oe 33> Shoctuves :
Shoc 2 1S 0 | Colleen op
drsenbten BNI ea
rae uyed fr shuckare 15) 2huep
e kupaord
. on of") Sou.chise : L8
Gainjle ores Leon of) Sbuchs
Shuck dudent > Stuchare name’ ”
t
int id; l
Chaos Mares ©
Float ery; soni
bdz eae wants
in order +9 occey’ Bester VOvibbler op
tctuwe ue We yrerorm. -
member Variables of
° 9 struct ie
°
6.44, 0.0008, 0. Mares,
© proyom + create O structs
woth the fields ideas, most, ong
‘Aetesle of Single -ttudent arg
details. °
£6
Ae indud: fo sthon
Bese student
Fon ome Luy;
Fleet tease,
5o5
Wont’,
fo etd tudent 0,
PERT CC ait dog,
SHiodluck
Grek erp
int Tas. ‘
Shas rare C10); .
float Solan; 7
59,5;
Mn ty
WE Cente, £0 enlay:
"1 OAVE, Cope Osmarts) i
rbienome, 4 bsalans):
eramest satan!Command “ane “Aigeeements! Hructure: Pridys:
Sine : ssi Shae Seuckiven Mibyss es Fe
these core bated 07 too eo ot rte Are used 10 read deteils
‘ * Bu Hgiup of © people tits, employee, stedent,
Argument Values akky qe argc, argue 7 Coloma, eke »
eg *
D> Oege: Te counts Ramber OF IPPUL Ogun,” sect emp
and pur fle beatioe i SMT HL sovint id:
@ en eS ' _ Chow ame C20};
av 2. Bk. Qe Abe value lo Ake fom of Noat slows
Stags sitet a ‘ ¥ ater: > shuchue Airay
SSTREL an dwerss oo Werke 0 “C program to create & Stucke
a Jes = of emplage coith member Varia bles, id,
ans parametess —>,,[isa035 > mune, salaiy arg riod the, de
| BE ede < Sdioh> eo: | empioys and degley those ‘detaal:-
mainCint age, Char? auqv€ J) “wo ae “Abinclude ie
it qaenate se stucl emp
pro Coed argc): eS) L -
y ik Laren, onan inv ids,
Rasen fv Guts: sere s Char name Cod}
SETH! Tin Pavarsters 4 given’ G float solovys
Bret vals so the oMat Gat C File” | Yates: ;
_ beak ee pe Vatuess- 2.7 jer nd mOING)
Brau) +, 2 Too.
BE sintluceectdoh= | int 7
RGmL IN Code pact fens je os) 210; 144
Cami Gage, Char* asgues) : ec oi cro: 144)
“ PAE Center id. nome, tology");
sconk (Hd ShE RO OCiI-Name, «
tas y 4S soley) s
x Oxeyeity or et Tit © thd
“ Y foie i=
£
proef Ct Latte ZS ey ae, acid ia
gus! 10 2030 4D
whet me wie
C1 \umed\ DELL \escumeeti\e 227 °
. Newz ose ¥
|
|
|
i
1
i
iQ,, Write aC pega
| Ranployy Cid, names
| OF Vemployre coho Td
ANinclucle
® struct cmp.
vfor Civosiessit4) :
GEIS tO print Mame.the, |
‘ | € print Center fanace, salaig 7
ir Cstremp CaC2-name,
+O Ingenthal D=20) | Seont EAS LH" LOCK etd ACI -NAME,
4 OCI -sahary> 5
Chav ranee (303; 01h, era hay
flood SQlonys «
foi Ctrosies sVaas
a Ub Cstremploctsename,Y nishithav) = = 0)
g gaat
breot :
3 ,
4 ‘ ‘
wf Ca==0)
| pant C#fdutn not -Poana") 2
| evse
pun fC found")
5
a teehee hs
: Bo Wilke OC progam, -t5' A> Aol Employee
dejouls a.nd Sort hose details bared :
sok | Kehna we.
Ae = $06u2)—> 4
LA", AAA, AC FNOM, OF) Fal
cepa,
‘Seovich's © 14?
Ive OC prorypearn,
Feoplonys
wo veo etails afi §
tha.» Using
| Wa dy \
CHOY name Ciel;
MAN Salary
Yotoorre,main C)
{
int G95
Print $Conter a")}
fant C*Yaen) gor h? a 4
AoC mop ien sing! a
Print (“enter td Orne Kolary\nt)
Tom Ong ucut" £0.00 5a, €0¢;3- sree, £009:
y Sabony),
br Geo; tens ey Pere
£
for(j=0 sen-i-t jay)
i Con. id Saljnd- id)
te acy ; a hoa
OG ]+ oly4iy >
acti] = g
y
4 4
print, Ci ies cotatr ease ce
for Ciz0j. Len
print? (iay ces acy. ia ad: hate,
ac $alouy) ) jTE Is G& process of oiganiscetion of data.
— pate Stckurer Are dawded into. tuo types
D Uneor dota ctuctuie
a Non- linear
dota ‘shuchiue.
—> Linear pota structure |
The organisation of dato. in linear
order is said (6 be. the linear, dota Stucture
stock , oue, Unked Le Ore Comes under
Uineas data stiucture
—* nod Tineay Doro. “Swuctuie +
“Whe ncn tinea Guvargement: of
dota is said WD be pow Vineos dato Suuctue.
Ah t& VWees / rors Ore cormnes Under non Linear
dota. structue.
Stac
Stack is ' O Linear data structure
Wheve elements can be inser ted Qind deleted
rors only oe and Chat is top):
he Aechnique Luyed in & slack is FILO (first
in last cbt) B& UFOC lost in firsk CUO):
Operorions WO QA stack
- Moiprly there Gue boo types of Operates
Gre thae in stock,
“they ove
pushC )
Popc >Push).
nine process OF insertion cf elements jag,
sthe stock is Known 03 push epeoton Cruahe sy |
Pop C)
~~ the promu of deletor of aren fay
the stack 15 FOWL as poP Operation Creseyy
Woks Tribaily the value of argc
Ly
gets incemented byt at cok insertion . Tp |
Gets decvementa By ak tach difoten, |
TL kOp= 1 Indicates stack is ennhy
TR tops skock sitet the
is 4utl A Indicates Stay
— Consider on a ace
120170) 4orS— INA Stack and ale por fim
Ake pop OPOALA ater insertion OF au the
element - Represent the topvalue of 2Och
Operation,
Tore 1 tushio)FushGd — Pushtsg naahcas) rusk)
= See ieae| a = |
: oo ee Nis
. Ee ‘Tao Sfae af ae.
oC we ‘Gel
3 dopey
PorCau) PePQo)
Se dl iE | i i
2 fs 2 a |e 1
as te |e
te ie) i
oJ ois. we y
J, Witike O manu diver Dreqram fo: the
Following operations on stack
Operates, lie (pashOy:! pop dd . dislaye 3, frp
© Peek CO): si
attin luck
int O(2]), tops -1 Hite- 20;
TOOin C9
L
+ Global declorotin
hak acces whole
wogarm
Wierie role program is true
Shea) synteny SEN TRB toni
v atte exit
print® Center t for push \ni") ?
PRNLL Center 2 for popdn"d
pant enter & for display’):
); 22
pene enter 4 for epee); =
pants enter ang, oter value for eait\n ;
a variable
pes ‘
chanenon ov Pe
pink? (rene: ar Choice mys,
seont C16", 4Cb 3
guiteh CoA)
: Case Vi pusha; C insertion)
break +
case 2: porcd: CAetetior)
break:
cate 3+ disployc) 3. Cdissleying)
break s
weave 42 doped; ,G Pant, tor value)
break ae ee
defoutt exiEC)
i]
5Ss “—__—=—rit—“‘“‘“‘i—™OSOSCSOS
puho
x ‘
wee, af op veaches sitet CEM
FP Chop <= ite) anne wah BE 92 OE Hse rtng
u
POUL (™ Cannol insert");
3
else
L
pant Cente o)
sant (47.4 inyi
opat,
aCtor}ra; Ceer aGia- 20)
43
fort) +
x
Uf Chop ee) HE top is a then there 1S np
Neenent in SHOCK Comphy),
Pinel C cannot delete"),
iat
for Ci =top 41> 0; 3-~)
Point C8 aN" acry);
3. -
opp) —> this fonction is used te disrlay
$ epvate of
iy
given.
pint £C"% 4", aCtop)) ;
SQ Wk the follaring furchvas oF Opera ty
ym SACK ~ PUSHLY, PUpCr de
ov peek Cy
Pushc)
i
ayo) .tuppe)
int 05
if Ctop = = site-1)
t
prrifC* cannot insert”
5
a yond)
pet COs.
peers 0
qopr+s
acer ns
y
port?
tip CteP ee
print COCO
else
ze “3
ee delet? 3QO Aiecoxe iti 4 boyd 06 come |
Queue: ,
= An queue we fyllo2 FIT Aechnique Mudeestdiogs
Chest in fet out) “thot ans the elonegy, 4 INclurle
ce acyy
OG. o§9;
aGrd: cy
%
A 4
5
Frnt Ci Anam £0 toughen
dow Creo; tensi ee) 7
t
PON ChAEINLY. £07 ongid 0 sone aie vee