0% found this document useful (0 votes)
37 views22 pages

Programming in C 4 TH Unit

Programming in c 4th unit

Uploaded by

zs170219
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)
37 views22 pages

Programming in C 4 TH Unit

Programming in c 4th unit

Uploaded by

zs170219
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/ 22
WN17-0y DRLAYS IN""e = mvtecoverien : An annay can © de snedf “asa collection ef dato objects havin Same ype ana which are siored ano an O Cconsecuttie @2 continous memoy, Localibr with a commer variakse name \dyels or Akenys : 77 auays can be divided ialo dwo Sypes : wif G)0ne @amemima/ Amey og ; / (2) 9w0 Damensdonas Amray 1. OMe OIMENSIOOL ARENY : ol an ath ely ane Subsoupl ss calle! 48. one -alumersisnal OUVIAY .G4 st Use | shore a Mist of valites in pn 6, veclbs. these Ltt, 0» values shave o comma name within the compaléa “meno7y. i LYQMOIE : ALL Of Values , Vers | | on A(5) Al whic [wo] 0 | 296 DIMENSIONAL DLAYS * 4p omay with Fw sab scupl uw called ay two Aimensibna/ aways. sp hes a tit (G venatles name using” 106 subseniph een ray callow us be wa Shove vals In yn Z0ws and Columns yormal pes itl 6) By using N00 alimensionas aun conta) tying type o} qpenations aw one maby . JYOMPIE: ape- sat Als] [5] > ely oT BT colts &%) 90) w 20 | 20) 19 ® | 30} 207 10) wo) 40 p, 40] 30) 2 loi] P20) 10 so, Yo 30 | a G wy | x OFC RA NON Or Da MREDY : Onay can be declared sn ‘the Same way as vawables bul hat annoy declanaton as uncluoles. name gy rhe |a@viay , Suze og the @uray and even some jlimes values — belonging “10, that wvray. (SYMIA ? 2 Dalat Evanrse : | tnt ergs sey} wa int n[sJ ikea TNS int 0 PE oe Sg Float moneys] FE | double wale 07 YPe> < hry - name > (SIZE) 5 Y mninpuzonen of APPAY Ama con be sralialpet at the ime % declaration sey Initiak op anray includes “Lrealing an anny and ASSIGNING values Lo uf by usetig the “yoltowoing proceluxs. Sunny : vw | Fp Pe Aram > F57269° 1,4 “Ps UG inf x [ 3}: - § 100, 00, 3003 joo Mint 1-05) 95143, 2,17 float pal (3) : void main () : f Int i, x i ’ (6 5 ae 7. clans Cy, 145,635 print “the elemenfr Y enay ln"); for (is 0,teesiea) | a pout FC" 1g", x CHD) 5 getch ¢) 5 i IWPU1- OD1PUG + the element Y aay x "2 Bah Ges gr” FYOMPIE 8: P092aM -t0 “ao @ hist oy numbers. # include < slaio . b> # incluck ~ va matn C) So Yi AD § re Clrsent y+ , Pount f Center the no. og elements \n") 5 Stan 5 ("Lo 8 n) 3 punt , ("Ente “hal numbers tn" 0) i fon (0 sfen sig) ‘ % Seanp ("Lal w apy por Ue Hl sjen: ya) , aCxlT=hyT) A ee Amp = xTiJ; XII = xUjI; uJ = tmp; \ 1” senting ends */ punt 5 (" souled tust \n”); por (i=0 sien; 344) Paint} ("tot x Lit); | getch (); a a | LPT - oud idnler -the nb -Of elemenfe 5 | enlen 5 numbey || 10. 30 20° 50 4o sowed fist i y 11026 30 YO So. sa a eee | “auto. ONEISTIONIA DREAY : vin cmay with 104 subscripts i.e, dysned with nows anal columns ss called as two atimenstont nays. Of wo alrnenptonal aay contain st % gwen variable. name’ ‘Ustng wo | Sabsoupl 2. allows us fo Alore ith: ements in the porm Op mows ® ZA ® i-€,in the perm % matiy nepne sentation SYNTDY : 2 Qala ‘Yee > Te-sizé] Ce-stze} YS ie x0 Cys et i 40103); oss Mr 8f3) 123); 7 of 1a 1 ed Syd ” too i ? PUTA ZONOrI OF IWo-oImenIsIenihL AREHY: par same as me dimensional wviay dhat the v0us anal columns shoulel be inthalijed in cwonale braces. syniany : | Bala type > <-asay- pomeahest ice S126] < wy: - + FTO: : Element list? , fae XC CIs $429, 72, + Element List, ig Ug bath Je, : Element Liste Sea Fes ” “slemend bist} ata] os Beare vit} Ge Line ocr = Sting jt sgh 5 > Ty Pils] | ns ® ink CONS) = P1753, £45.63 9424933 5a) 4 Panes t ibis “| 1c px0gsiam jo? ation Op 400 mabuces. ¥# include < steno. h > y include 'f Ct = PML ) 9) “ punt J CMabiee no} compalile jo? adelion lney3 : “erie? 019; ; i @ Punt 4 ("bnlen the elemefs of xin") 5 PO Cis ost emsty4) §% G=0 s§ens jay Pb Cha", & CNET); punt f ("Enter the elenerts op x\n)s 1 Ciso5iep5i44) b°) (3505) en 5544) Scop ("hol "49 YLIIED; A” Sum mation begin 4); 49) (f= 0 sfem;i44) 49 C505 sen5j44) 20IUI = x0 G14 yl; 1* suramatins enol? / puts ("sum maby z\n); Pr lr0 pH emmy i449) i , C= 95) / # include // EYOMPIE 3 - Woule 9 pr0gvom jo subshiactory %» 4wo mala ces # Include ¢ slain. h> voio’ maint ) ye ¢ ws iE x (5]C5J, y £5)059 ,208)C5), m, Pi); Cluisenc ); d Punt 4 (“Enter number Of Nows and Clumns OY motiy x \n"); Scan S ("Lal ‘fol ¥ um wn); Pourt § (Snley number OY 30t0 % column Of Mabuy y San) (Yd pal, C1 = pn (ok~9)) “Mabices wot compabiole IO substracton \n"); exit (1) ri 1°” (iso; tem, +4) (I= Syensjiay > CIC I= x CIC Y CG]; = /* substiaclion ends*/ SCan DU" Lol, ym Linen): pou nt ) (Zale the etements Op x tn") ; jo (7-05 fepsiagj 1 G05 johns jay) Stan y ("1d vy ITD) I Substroction begins */ ~ (7505 jemsiag) he 344) joovint } (algy malouy z\n)+ jor Ciz0 stemsist) f PO7G=05 fens j44) Udy nt”, 209)1) 5 punt ) (“\n”) ; uJ an ) PMI 3 Be loule a 209 S10 jor muléplicalion 9 400 mabuces. #4 include < skaid. h > | # inetuole le include < process. h> a Voto! meaun¢ ) Zs | If ec | int ane. YCSICT »204](6), mrp, 9,1 CS cn | Print ' th "Enley number Of ows ang! | Columns Of mats «1n”) - Fal”, am , Wn): Livk, x“ s $ > a D CRntey hub ey Of Hows ang! ©} matuy yin»). Pound 5 (vio not Compatible 1° Mulbepstication in”); | Crit Ct Pount 5 (« bnten the elemenh op a\n") » Ss yor (is Osi ems t44) 9 Gs05j en; p44) Stan ) (“Aol & HEIL); PUNE { ("nen the elem ents of yln"); for(i =0 ; \ep 4 ita) fa (3: Oo" 33 <9 4) 44) | Aton 4 (a, wyLiTEil); /* Mullip Uealion Cy malice Op X OY Stan */ fox Cizo5hemsiay) Fox (05-95 )19) P2CICj] +0; fo(k=oj;ken; kit) ADI GH = x04 ye] G1; ; he Multiplakire of mabiuces ° ae int (""Powduct Moliur z\n”) » fo (iso; iem; si44) { Ao G05 jeg sjay) paint p (UTE) 5 patint ("19"); . te Uh. cll Bramerk i: c prognam 40 pearl Lranseoge op a malur / : [the anspase Of 4 malrur s Obtariey by Switching the mows and columns oF mat J. L # include Y . +H inctudle < conig. Void main ¢ int q CGI, star], 1,) 5 Chsen ¢) 5 ‘ poxint p (Bnter the elements Of the maby, ln"); atiItj]); given mabiry ¥¢ eae) I” Cis05 1e3 sity I” G05 435544) Pant Cy al, ‘ acid); phe EEN Paint’) (“transpose ep given maui in) a ee po Crop 1237 i447 | i for 505 jaa jaa) bUICj1 = acy 7075 ve Punt} Za", BLILI); | ey Prune 4 ("(n”) ; | 2 “ J || 5 | getche) > 3 PE IUNTES, wu a ¢ Program +40 sand the avenage marks f'n skudlents Of pive subject Ju sach subject wing amays. (Mos: # incluole zedeud.h> ‘Wi a a int Snbd, 51,82 ,835 * Float tot,ang; choy snamelo], eS print J [Kn ten student no; "5 Sean 4 (/ol% & 8 é 8 pount 4 (“Enter subject -1,sub- Sub manks 5”) ; Scan VC“hd Lal %d%% 31,252 tor < S159 $535 Ovg = tot/35 PXINE j (total = 7. 91,408) pout } fs Avenage = =p. 4 5 ak ~ PEPOMPIE'G : ip | biule C pmognam 4o check the given WOR I ' Retinctnome’ on rot. Ans: > 33); aug); # include # incluole nite: Voiol main ¢ 3 char shi Cag, nevtsoy; int hashing ay 0; Llasen(}; a punt 4 l"Enlen ny bung (marta Chests) Hn”); gels (shi); “jouci = 05 S64i71 si eanaMed | ® ™ Grit yk 0555205; —)hat) new (k] > statj]; nevCr]~\9!; po or O3;Stefi}r- No f44) t ib Ste] = sevei9) iy 3 flag a: break : 7 3 Na punt J ("Given Sting us not Paltndxome «\rn*) ; else Print p (“Given Shing as paltindigme .\n”) : getch () 5 @ Y S90MNIG HOniOolag LONCHOMS Inl'C’ g of sbung is O Grol Y levactey conitten Logadhen - fe "460" "yer.e” “96123” “GORHOME” ; To penjorm manypetatons on pny 4 data 6» shungs "C7 lang wage pordviales belt in yunckons 10 make chan a5 wrth in the Sbunge , These punclons, ane as yollows : . (1) Staten ¢s4) (2) stacmp(st,52) 1G) staepy (31,53) (A) Str cat (st ys2) G) Starev (51) RUsEREN CH ahi SUnetion ur used. ‘elim -the length % the ‘guen sung wher st us Ane name Oy ww the SoUNg « Sitar: strlen C54) #2 Shien (nee) D3 Str len ('ngc173) 4 Stalen CAppe") > Stalen C'ABeD") 4 @ (51,52) = this Sbuing Junction us 10 pexjoum ag Comparusen between +H, given -two C09 COE Ame irata “Tele < J cohen sung $1 js den than £9 . the Jun chon Aen a yale © when Sl=s9 - finally the yunction rxetunn a Value so when sisso 2 Stecmp Used Syveny : Stremp (st, sp ) He? 3t = “Aen” F2< " og Stremp( Styo2) => >0 SS eeY (51482) «the stu copy punckon is Used 40 “wopy cortense oy one slung inlo othen NYS. Sunlar: stacpy (81, $2) LY2 S51 2h > S2> “4ecn’ Stacpy (s1 182). > Aecpé | S8cat (s1,59)’: The bung concalenatioy 27 is Used por Joinnng the gen two shunds one YI) the oth&n , the @7 $2 I Joined! at ithe end y he SYYIBY > Strcat Gripes). Bs gy =" ¢¢\" 92 =“Cotam” Steal (182) > ICECREAM, §1 ="G" , S) = “poonn? bs teak (51,52) "GROUND? ay ) 5 Slave (s,) : The bung Teverse peneb, is used yo NVERSENG the Given Shun ‘the nevense SBuny mMachantsm roles dewaatting the sting powm ending to the beginning . SYNTAX + Strsey (string) Poss = “nec ” | Strey Gi e DC BA (2152 = "Mana St39¢y (52) = Maony _ Frameset ss: c pxogaam +0 concalenale +he given wo Shings and print new sbung \ Hinctudle < stop b> FE include < (ohio. h> main ( ) | chan $1 [10] , $2 [10] , $3 [109 , i Sent iyyks | pount 5 CSEnten 4h genst thing \n")s | Scary (#7. 35” 1): Paw, nt YC Ente the seécongl Shin ng: w a rane “43,8 % 2); = Stalen (81) 5 ee Str len (s2) ; Rs eet baa) s3[k] - SLlk]; fon (E=0 , k ejb 44) 83 [isk] =$2 [kj 33 [ray] =\o", Pount p Che new Shing is \n” sB)5 3 : i oe x fue ortkan = TOUS SILKE fo, Den loser) #Scant( , pen), Fclosec),f paint , |, The help Of these punctions the usen Can open a Jule with the data pule Speupseattons, cneal® and woule imfermalio in +0 the jue ancl can close the ule. ‘The lowing ane the jue pororeasing nelated pur chon . 4 FUE OPtn! function fopen( ) 6. visi chosé funclbn telose ¢ 5 C-FNé meus tunclons geet and fscant¢ ll ; | a CUE oe1PE7 Funchons put el) and t f m$) (a-THE FonICHON fopenc ) © This punction ws used 4o gpen a data ql . Moreover; this punclion nelunns ay avinlen Lo a pale .The use op the punction _ File pointen..Lopen (ile name, maces 3 ~ fseanf (F pla, “Conk Shing’, ® M+) 5 hey fptr s 4 pule pointer fo We eeive orn, ied daly conhol sting ~s claly Specys cation, Mist | ik oe Of variables Jo be nead- Fscan fCinfile,"Zol Zl! ® sno, & manky. THE FUNCTION piel ) 83 faurtty ) Frome : 1 pelcC) Lanction : thes Juncton JS Useol auule a single chaiockr inl a jul agerenced — by ‘she pute pointer. che dsage o thts junction us PUEC (ch, pale poirder), cohene Ch - the character 19 be coullfer jee Pointer - q jue pointer 4p the 10 that necetves the ‘characte, . (2 f paint £0) function * shit fonction | USed t woule a BO” matted data in -10 18 gun yale the ‘Specypsedd yer mation Lf “waiter om the Specyited pee. @ “he generat Jom YF usage yon Shis jurction |f3 ; f sunt whene fply F(pts," contol Shiny”, list); - ule poinlen 4o wut gq jor mated data. Conbio/ Shung = data specpicalione list - ltl 5 pp of vawables to be Wwoudlen , adramphe: f pountt (out pile, La ut’, baste, moss) :

You might also like