0% found this document useful (0 votes)
15 views

C&ds Programs

C-programming language codes

Uploaded by

mohanvajram878
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
0% found this document useful (0 votes)
15 views

C&ds Programs

C-programming language codes

Uploaded by

mohanvajram878
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
You are on page 1/ 21
t Print t Cu ") 5 Print f (“\n'); 5 veturn of } 7 writea oe Progrars to adel fu20 num Be arial ; # Include 2'stdio.h>. al tinclude .2 conio Ly int moin () | int t, j,som, Cdrse Wj Pant (“ter the som aie in scan Cb xd U1 Ni J seom Som 2 4445 . 4 oi Pant? C %A+ Yd = %d" eo, -yetorn 0; j . eee * Opteron. a hase ’ wyeeibecy “7 " Sorlcde ¢ edebiodk > a include ¢ conte Wr ink waln ( ) { es One cs clysevy , a find? Ofenier the 1wo digit); i cconf Crd 4%", fe 4 PY? y Le a+b paint £ Codd: “ os cea bs pint (You b xd ai Ce ath, , pant (Ymul « ud Ba tats Hs we iavolt (Maid Pee ray Print an Ton it he yefowt n O35 : saa oul pv! % cater The digit: BBO, be Ded 3 we . thd ene Wo Rel 7 write a Progam Ged OF Two rY ysing ye Wwysion, yes ston : ry is Ahe PVEcess © "ad. : he? Cot n viata ys int main’ ) . inte Oe a : Pint #C Enter fue! spumber! al wt OC" vd: va Ra.. ue 7 of we oe ds a," ae Print t CG i va refevn O4 a heft Girt 1 int nv) ‘, (nz | -0) yetvn OF (nin, 4rd: elsé valu? iy } A 4, ncwde a stdio- he oe : i void towers Cat, chor, char, chav) ‘07 . S Snt main( ) 6 os Snt num Birt C Enter the number scont (°%S", Brom); Apwers (rm, AEB eels vetum O; J void towers (rt, nur, , char fe orn Peg, Charly of dises +" 7 chav ove Peg) 4 Tt (num . 1) Print # Clq move: vetn; } } towers (num -) Bom Ped, aux reg’, +» Reg) Print ln rove disk Xd fom Fed ¥ bregyer num, fom Peg ry) towers (num-1, AUK PEF, te peg, trom Peg) + 5 disks from fg 2Aab. - RHC, a eats) SE include < Stdioh > int main Cy there “berbey, tat yi, Som-o; Pritt Caner atte Sear for C Feo te ay tee i tor (deo; 423 , MPT dead, ti): Scan # ed", Gat) NY); nn dmatris day j : mabrin Put Ch by onler “second : fer G0 ie3', 4) soaheg i ‘ fr Geo ide si dt, ve C4¥a; 6EIG)) > 4 pratt (The first matin is s(n"); y eo 28 Pd oe vinkt (Thesecond male bo G pratt (Thesec * ¢ | . Hey Geos 16555 I By (j=0 S523 5544) opp Dee jess HOF By (= sport C2 "afJ4)), § tt te b (i a: es | girs = a £C\ fink fieo, 4° -1, ft); ee fate Go ee : Sumaks O : a Ff by (boo. REY) eat), a i Me cue aiareyre 7, C (4) Sums Avkob monies) 9 Print (In vmullipucation °° bor Geo, 194 1) toy (dro; g43 oa) ‘ont Cra C07 A) Ji a Bo vcbon 5 wD Write a C -program ond smallat number jy Pind the largest from a giver vst? “of rem bers, Gap 2 Weer [rasan | wv B34 = ofo) small = a (0) l ‘ % om | Ne tan inclu ce é Sielio b> int mola 39 gk include & stdio-h > Snt main © ) 4nt alo), shze,i O%S: Print C\n enter the size Sconf ("%ad ", & size)! Print tn \, enter the avray for Geo viz sizes TH Scant (xd) * ati); big za(o) . for Get, je oi2e, HW) aod Cig za) ) os ea) ; 1 hea Prindef ( HCl, the lads s gmait: VA , ey: of an array: Xd “n\n "812005 J tnt reserin g n 1 a6) (Big smal D9 Ste, 7 elemen ts ofthe a ia le << the Oe 1 oo Ws alo); & (iso, absize | 44) TF (big Bo 3) { spall. a(5) 5 Pao C nly the’ swale ements Ho) al) | teturn + : j write a “Cc” Cregeen | tb vet “foo ahead ndde estdio. [> int ty ud main ¢ J . int a(io}fioy , bGe) fe) «Che iid 4 ad Sum ~ =O: Way Pint (In fe the aa ’ . we sf ! : Ay (ico 3 £314) mahiy . "); § by Geos 423 i 4h) \ Scarf Cz", aiIy); 4 y pankt(“la Enter the seford for "hoy Bea s34) { ty Go, je3% gH) t scant (“gay Lert): i 5 ye I adesben Agi 7. Bee, page ith U foe Gig, je3 15H) ny - off) G+ 6A) 3 rd Invi a, wat gi Ome reyrbont 3%3 VCs Teo > $23, 344) pe C aad): matrix v5 a Polf Cm): Talal ed j . velour 0; }, fe Factories pbogiam using recuvsio estdio h> int -farclovial (inl 0) 5 SIpid wcin O) arinclude fol oy: atl Got £0 ter the clgnt ): scand (4d Yn)! y. factoriod (n):, , Pint (Te fretoval of Md is vd; i) 3 int Padovied (fata) ’ peace { ‘wt fact =| BE Raa) ol Yefurn 1; ve ba a Tt (nee ) ae reborn Uy ‘ tact « o* faoil(n, 1 return tach, ; D <- program Foy selectian sovt Recourse program, a B jndvde estdioth> pinclude + Cone Ce int x6) = 317,33, 4h) W883 ; Selection sort Und | main ©) i chvserC 5 fove sovfng?).s Frnt (% Away elements bce Boy Geos tees HY 7 Pant C¥ A, x6); Selecton sort) 5 ~ tuintt ("ln Prvay clever of tev sorting), By Gaerie ss iE, arid (d's C3) j Selection soit Gots) AW ink le, 2 temp, ming bempex(a) ; Tt (ne 24) ; vebutn (7), “ x€n) xP), eo xP) « temp; Pen; mn : ony: Re tov (een tH; kes 5 Bip cxgede ind. J Selec eengea (wp), : J C pregians “For stack” Haclude < shlio > Hindude ¢ Conlo-h> | Hiadude esditioe he H define max 6 | edie ink stack Cm4yy; oe Int bopsoy int menu )s toe int chy, * clyseveds ‘ Print’ stack operations ‘Osing ‘aivayt Palit Cl oe etka g RAR ; “Malar, Pygtowd, Poa! Sanna Pintt(n a, Pop Ny. oe Pint Clo, ‘Oisplays), Bothy uy, Qty), : Pritt Entey youreheees. Masha Seant-( xd ch)? ; Yebow, thy titer : ee wn by a # (tops 20), «neat Ma la Babies semmplj~ - Zoid PoP! Ce ; sf (tepe+ 0? See : erat CO sha onder tlow-05 7 veluin 4 y else oe pant? G Inlngopred element is” wd) shack (teri); ‘ void 908 he t into fo’ of (op <2 mY) pint ("\aln stack ovev Flow"), yelura 4 5 els 2 i Rani \n\n Fete dota N scant ('Kd", t doled, Stace Chop ed ata, oe top ett; . Printt (*\n\n Data pushed into Stade"). t } Vo%d mame ) int do 4 Che menvdo; Suorich (hy t | Case; \ Pusher, breok % Coser, Fort», breast, Case, display CY, breate , cose ky enit (027 da a 1 a Pragvom toy Be te include estdioh> sox Buloble st ain clude 2 conio he nclude ¢ Stale Ren me MAIZE S00 wk Vdd wbblesort (inlawts, inl mavsze); tnt avd, 95 int maial) i vat i; eds), Print ( \attow samy ONVOYS, yew wont tosort Seanl (%I" ay): - Print! (Fator the values one by baes"), for Geoyiens jay 2 printf (“water element %141", 4); Scant (aa Law) ), j Print ("\n Avay hefove sorting + a i), Sov (4 oO, ian uaa) Prinlf C ‘ei, "owiy, Print} ie \o bble sort Cov, n. Drint (\nA ‘yy ae At fev stern toy (eo, yen ysiy / , ( aint ( (viv ow(i))- vid bubblesort (at one son) } 1 Gut pet How mors elements Y% wont to 5 one by ane Enter the valy& Ente element ot eee A nter en tev elem a Enter fermen a femert od Enter & Array bebve Sov Hg. * (uy, G3), Go? fi) ‘bo, Prvay atier sot ting) i (35), 6a) fw), (od 9 Ke pre : om 2 Finoxy wavel be coe eimai es Winclucks & ste Vio. |, Winclude c+ Adib, ie HW include ¢ Conoks Noel efine MAYSIZE 600 b ant brvseawh Clot elements 1, int maxsize, i Jord Gubblesort Cint elements (J, int marsize): int elowent (MAysiZe'), maxsize, key ; : ink main © ) ank 4, Ros, Pint f EC \n-How many elernents you erst Scont (y]', RMaxsize) aintt (nt ntor the #ey Scant (vd "s2 ey cin C2al \wFater Boy (i205 ee 4394) a Ge seavchect! ) @, values one by one a; 4 foment at sth Pint? (hn foler ae sek (ga Rel CD! j bobble sovl (clement, Maxsize, rey ); E44 fos--); PoSe [inseavel (elements, wiaysize, Kes 4 f (Posh z -1) print f ("\n the ay Bd is found ot si Hon Xd” fey, pas) else \a tne key %S not found inthe sist"): Y , Wnt loo bble sort Cnt element (9,19 & moaxsiz9) ois o glee (Bist + st mrp (ke + @lemen Pickle) ) of (ey A 1 elge tf Chey 2 elemerl (y1'dolle J)

You might also like