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

C Program Notes

notes of c program by piyus

Uploaded by

Shobeet Tamang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
227 views

C Program Notes

notes of c program by piyus

Uploaded by

Shobeet Tamang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 137
Mahendra Morang Aadarsha Multiple Campus Biratnagar, Morang BCA Program Piyush Koirala C Programming a. eee ‘Vie i sed Roda, gives meh yi! w- Any docial program oe a Computer _Proeram i is set- Of Instruction (sehedole) th that ts a _|@xecuted. oy computer givens ufvec _ Sit Payroll manavemen en fom pute vy)” ete. Ree ee 1s a basic comman a fs_unde rstecd and carted out — Computer programming | Doe Peet ie an Stade pea. We person | who. ow id : eS a : i Programming. lonevavets a. Loinguape used by. computer ee ram %s known as pregramming. hans age. -The boate diterence between homan Lomougse and Programming. languape fa that the proora. Ser Oo emmino. Languaee _‘s Casil y- on derstood — aor aoren Rcueroan b n_enguage is not. for. ¢, Ct, Jove ,c # , python etc. _ Types Pproovammine, lanovace ?- There are Pollow? zt ° Fe er! _ fo owing. “types of ee gage =} fd unten tn the form o feteary. (0/4) | Machine Jevel presramming. Langu oe pertin gee cho. % ts, difffcut te" understand and "nteyprel b homan be? but to understand Ry Sita Eee aE [Computer Cana ore chlo, execule machine | code. en) ese ; a ee st Ying] corresponding MNemontes to wy Oo ue - pram codes : €o:- 40 11 ny, > Machine el 8 OE Qadd 7 Assembly code. To execute assembly code, the computer st rtrans(ate % +o machine code and then execu- 4 -te . The dranelation 2s done b 9 special known as __assernbley. ec. 2 Glsaembly. sode_(aem) As aiNecemblex| oh ; machine code & exe) aie < i. [enecute I 4 ovtpot Tf qa co Prostamme easton > High evel dan wage j It Should be tro. execute. ia L a ttedi fnto machine’ code (ebfect code) 45 L ae SHG) att, dava python ete. . a iM Toone p ex bS—[Acee rbler} >Texecute| qg i i ics _ Aasembl sods) GAG Meike a _“ Database”. 41+h generatfon Lanovgoe ee | Ari + Sth senenaton Map Ire ami Heater {Program ming ols‘ - ag or here are following _ tool Ee 7 tasks) used tn . Programming . ® A | cortth Wee So es os @ tlewchart_ @ peeudecode a ‘Aloorthm + - is written %n enelish Langegoe: FH % etep by. step (set = inétrocton) S01? of. given problem Date L Page No. loorftim % alusaye wntten fn enoltah tad +the simple \ntrest shen ( P78 % Bui: = “Principle een dime | eo: endl tatel of dntrest (7) j t pot 2 Tantres! ag) Steps t- 6. dtart io os di 4. Take dopot Dit x fron woes 2. Find | calculate Interest ¥= co Diopla or mt the valve oft oa Stop. ~ ¢ a ee flowchart % pe ctoria! -represen-fation Harn » ene || Name aa ee eymbol. -diagrom| | mean rc i. de llogaie Pe ls) | Staton desitrn 2. | parallelo rom d EET be Tnput/ov Statement | yoces a rGloctahens | . dart Shox 2. Thpet three numbers Sy aoe ot BaD. 3 2-3. tind the dum of 2, 6,c | Cr ee 4+b+¢) Cam | 7 4. Dear la iin We es de) ea ats ey Baa. = eta). ere | ends [tp | | Concl##fonal _&totements §n algorith m and lous il = chart: we a " Mero; SE dnput percentage of tindiuidval (astudertss Ss: f pee fc) sh ee Yo Ea 5. pee a Gale! Ba ee. aS SO ee ela. Aa Ci. Om 4 yy a WD talenetion pict WE dies Division -” = Go) (p ii. i “\ deeond devie?on a (pe 2 Soh he eae Uv “dhird division: ae ag 6 aa fer age No. 3 Joput percentape (o » 3 a te a No ioe is : x _lertat dPalfnefon| on He cr ; No aS wk ee bteeest ean O ahebad | | oe! No Afursfon- ¥ e2 / fprint 994 deuteron) [ | BS upeior sf* dive | f— ib S| __ {pliat_ard fda) | | ‘E. cS Program development cepa: ye levee pseudocode = programming. code falee ) ! te paeudocode ty the representation of ales. |Xithm tn very. similar danovape to compotey _|program + — pseudocode fs not exactly. the jpreeram code, Since Tt fs written tn dhort statements: for example. ; Peevdocode to ind bum of two number: 4. Gtart Start B| ps dnpof qb dnput a,b Bis. S= ath oy, ecath ai: print Ss jorint $ HS ssn’ i en | Peevdecode to find the Jagest_nvmber ome. dive nombers: _ 2 a d= Sart 2 sel : Ya 20) Input Ot bs 3. Se loeb) es bor gee ltd Gab) at _ E42 petal -Qre tt fequires Pollowing- sleps A ———— a ragram developmen JHe cycle [éleps © develop a computer prooram/ sot. _ ° A. Problem Statement {i aden Rication a: r E Us equireme nt Gnoalesis. igi __ | 3. program cleston) system design cit): Neg Sra a ee |S: Testing. clebue sing Sie. 6. Documentalton J_Mefntainance and support TE i known as _s9ie (Sobtware Develop. ~ment Ite cycle) ti : 4. Problem ¢derttt Pcalfon *, Basta Ss TA this step, the tasks ts hich % to be | solved yp. _compoter Pregram (pru posed) fs tdentical. 26. - dh we wont 40 develop a payroll eyatem \ Then we ¢frot didi out what uaill be the components of this sustem J what will be individeal task. | fd U [Requirment Analysia t._ Tn +hfo step, the Input/ootput oP propasel system are fdentitfed. : 1 To do thes the user of Qyatern are consu ited and what they. expect from the Sytem fe determined Bl juartten usino- d&dterent prearom cles4an tool _|isuch oo Algorithm, Plouschart iB Puerdocedes floachart or psevcl cede. i Amplementatfon / codino * ; [the pregram design into program code. _ | Progr ram design [eysstern design a ere ,;the soln © propesed Problem 1s, RS Body thts dtep, we have q conerete sol of problem fn terms of either algorithm or. 0 Es aes | _Here, the prosrammer convert/translate MS surtte/eode program ,we need +0 select je ie? te on.“ lat east one pri raramtn.g donguoge. Aske Debu sing. 4. tooling t. y = Vorine.. the coding process there may be = Some proo an errors. which should a bo: debvosed or mond oot and vernovec). b TF rogram %, checked for destred | eg loutpot caotth oven Input. The. process cq lwalidatine _ovtput ts ‘known on testine- “There are ange teeting meth > = Alpha Testing -in howe 4esfino + q Beta “Testing = fasting, by. coat .| Documentation: - gevelopment process: 4 conetst tuoo q dt ty the uariten report of all dodh.sare i kinda Of documents. _ |@) User manual ee ® system manval Bometmes 4+he comments are writen tn the dovrce Programa in-line doco- -mentation . > Maintatnance _f Soppsrt * - Tt _f the post preduetron step cohich make Sure usheathey support ts! avai lable i % shoul be. ac on ee ; ane error occured abiern the aia | age Na | | Histo y The root all dangvave fe oe eC AL@OL 4nvented nm 4960. a Tn 4964 Martin Rachards develop a anguape called Bcpl- (Basic combined rooramming- anovoce) |-Ta 4942 ~Dents ert che _ken thomason clevel oped a lan guqae called (@? uahich — combines the feature of Bept £Ar@or f | @ wshfch % now known as c- fanguace | ea g Basie of care Linux and the unite systen ae Tae oes eee fe Baste elements of ¢: Chapter set '. a & . The available chapters in ¢@ can 6e eateoorized ac, @ JeHers + (4-2) and [a-z)_ @ Digits 1. (0-4) @)_ Special chept characters'-( commat) ie @) white Space Characters. Tab , Space Newline chargctorst 5 Tekens *- Tekken is a sequence collection of chara ey ; Known as (word! fa Natoral danguage- Cc has six types of tokens — Ce [] fetingel ot Constants 4 Dentiiion Be: aa Is ‘ | Spe cfal Sy mbo keywords and Identifiers ¢- q ATL keywords hae xed meaning. and these} J meaning cannot be chonged: 3 SI All keywords are written %n Lowercase Anse has) 32 keywords: Westies flare reterg to +he name of Variables cHons and anrays: di Wy 4 e user detined names and consists and a pts: There are certain wite 4 # tiers: 46 Rule of teen Peters ¢- | Pere aharacter must be _alphabak te r On ders. core 2.|\Most cortain only letters or + digits or & ||Unders core - cA RL Be ih Ee Z.|cannot vse ke Beare. ee i 4. | Must not contain, whte ¢ space « ; i S: || Onl first 3 chapters of ‘Edentikfers. axe i Signtficart: i aS | Constants ‘- pea s = TE means the fixed: eek ies “dont _charee during ragram executions-_ na Cs supports EeolineaineS + pes. constants } - de Tate ger constant a fe a. eet 1235-824 0749),etc- iene ee can be decimal , sce A henadectn mal intes oers. clas ?ntecer only consists of P digit from 4 O-F and start “wath ‘o! alw ys: @er- O37 0485 etc. Yexadectm al integer start catth box eat OX2 OKIE ete. eerie! floating point or fractonal | bers - oO: 0063 | - 04s ete. a single o. constant fe uovitten 7 inst vote marks - eter ta Gequence_ “of char —e , fn double quotes mores. Mpetae horacters “const ant nines meant 1s cTRAGeh new Ten. yey | Thsert_ fob (York) Tnsert vertical to) Ps hee [ udfble alert (bel!) | i i Variables *- : | @ variable 2s eee ere may be | Used, to store q clarta value. oa ~The value of variable can be changed _ urine the | rd oram executions. seine example 5 of variable Names aie; ag Average , =o Gin ee re er A Fe — Total = | The came of Variable eheuree be -ortenll = Counter ete deearding? te | Rule a dentttforg. FH ||Data +ypes:- —| Data types detfnes the nature of data fl Gg Supports the @ variable can comtatn. . ass ee, Smarty data Aypes met data yi pes rk + defin ed data types. Pay data ae ia Inte er 44 pe Tatever [character Sioned UnéPoned Qt. Wal Ghar un stoned a a -_8%ened char hot tint unsigned enor Un afgned| char | e fot: iret Unsigned | Ta id al es ae m ee floating ae £ No? [Float /double/| ten» feoad Oi | i SAL. Ong = demteolon Narfable name a iMac Sire An deta dupe: a ee Tyne 4 Téidel. Range Or Or pes char | | 8 128 to f Unsfignec ned | 8 Of le, BUG. Int a digned tot | 48 |- 32462 +0 32764 short Pat se signe 4G) | O Som, 6SS85 there. fate nse pees WWnsisned shor ine J] @ Long. int or signed co 5 ad hs | dint Par, | \Ondioned dons we on | lo Ar { idevble pea! | fone clovble Pai i Unatened tnt >| Decleratfon of Variable Jno. TH de¥nes’ how to “create. variable fol Cc When we create Variable 3 allocates memegr Space 4o thet varfable. Syntax +0 be clegr variable in el te dal type Variable name. : (Ta@reach statements end with sania Dp a , g i create. ai Nartable named ‘P. whch can nteeral cata: O , 9 eee i pie: Nome of variable Should be on?. } di wiable declaratfon staterment tells +the fall wine +o compfles- ‘ 1“Name of variable 2. ee of variable » sve ments te ron’ presram ! D) Text /sovrce caden edttor, _® C- comptley Gy) Aoader 0 vides the facility oP covtttfn Sa) fler translate +he sdure code Za Ge “3 ener preeram = Bijuc| oneic of ¢-pregram ‘- General Ch program has follewine s struc Ce Documentation seckon les section 8 G@lebal sect es | Sain section sof eceauHan 1 +4 openine) an rom +thPs pein). - @ tneludes 2. r low? oO | hmetic operator elattonal operator dooical operator ment oOperatoy se Increment Decremert- operator Conditional operator | Bituwise operator. Special operator _ The expression fs sequence of operator and operands. ‘Sai depend ne Spon | apes iad ve p oP operator ‘ig Used fn expresston + SH ic clagsitfe dl accor, ee -donply ‘ a OM Mae = a a pdb a 2o:. Be inane 1c 210 poeta fs used °n oe |-Yescion. Then it fe arithmatc expression - ithmatte operator 8 =e Meantno . eo Addn & stroction 2 _Ofvision Module division Sift iiaade | Pig Moe Note:~ edule division cannt be applied, to floatin Doimt data te- Variable ae float ela ype: : : Bc a ‘Examples using Avith matte ue DH am ES heme bere th lata « are ee ‘ae the _ I __lexpression ts known as integer avithma. IL te. Preie. oe Wiese | Hie AG) ; Ve Ae Hb LO Bo = 3(9e noes Feat | Hareb {2 Y ee clecorded) Ox ba 56, Atos < 2 (Rerninder) q hen the operan ¢ ie expresdion are floo pf. potat data then th fo) neem. tea axtthmeatic Me 60 /Jro = 0-85 7]143 _ _&§ Pe yin to/g-o = Cay o/s-a: 5 3 When. beth flostins. peint as well as iolele -ger lee eave used _ in an expression hen > Mixed avithmottec, al We encrtols es Se operator are used +o compare the greater thao Yess than or equal to eatery than ox “equal +o quals +o lot equals to a | 7 —Olep-fop-8 opi Pop-2 id INON-Zero . Hon-zZero _neg eere ‘Don -Zero 6 a o __ non zero. © ——— 6 a oo ™ Logical. AND a E z ae op -4 Op -2 oo-t || opie B si 4 re - 4 OE ie ee as li eee 0 de ‘f ‘fem E | 0 ® WE@, 5 SA 28 epfea | OR L @ | degical not a A { op ~4 ome uf © Bs E a 0 A a Asstenment Operator '- St te used to 2o the valve et» one operand foto another gk 23: @Naeby t] Copy valve ok ‘bh! Soto a? = a2b co e€ Nalve of “7 i" a BOs Q-2 Short hand 3 ry a> ak(m+4) a ‘In general , Cle Ac) Sgvicm as Rs written Ia short ee ee. Or, QE Ope= 2) memmen! /D [Decremer operator! eS ved +o Eviescese or icleareidise ihe. valve of operand 4, ats Shimam fs = Pitt S dincrease ro by dU te mam+t) m7 > Mecrease m by t (ie m= m-1) om Inerease mm byt eo _™ > Decree m byt. juvhen these operators dre used in enpression. — ee et iP =tnere Rtere nt is 29 ae) oy Ges) as ap ah mas A eo Sg se tte. 16 bs btt= uh ee 8 Mey? cl = to 4 u6 796 f Condifon al Operators The ae Apa arto Pa chao Relloiwine syntax: . pg, E FS: jen mpd is evaluate 18+, dh Pk fe te "S non- — : Day. valvated MEP a ce onal iis caleolated: cers bi tok) ei oe peeitab a+b best. 4 F en Paltb | by Then x> a+b-=1s_ BPiipenies= 52 lo Pee aS bb? expt exp pide fie It G >b) trve. s garg ae Oa aD x 4 Clee ' x2 enp3_ 9 Bpecfal_ operators '. I ee. - suppocts Lollowing Special] erator: G)|_ Comma operator (9) “a ee bl Size ob Operator (aize ot) a z _Pofoter Operator (f and ee (qd) Member selection eon (4 and +») jomma Operate’ - dh % used +o seperate relate 'n exPressfon! . EMO TY eize: etums vesolt Yn terms size ot (h) bitwise. Operator %- Pee re |G supperis the eperater, which worle cur “(0 [BGusise AND Vise. tee [The result ok AND operation ts (71 both | Gre have aivalue ef 4, otherwise PE ise. zero. : sa ea cl Ft = APb Works as aot ee AOL ae | b —> Loo er a aod) Ce 4 (gesutt) Bitusise “OR: e bits has a valve of 0, othemvise ‘I’ The resulb ot Of operation fe (oa! te both epee) Mel 28,624: San VY, emoules (AS 7 QS tot b > AGG: fos “ kesult: Price exclusive) O@ Mi Bp So Bee | The result of exclusive OR ts 4 tt only one _ ot bit fs 1- otherwhse tH fs ero: Mice MactaimS jb vy 6 a abe a LOM: Q ab! ae Lob spios fe fe i. |; Om: eee S (Result) (Oe o iS JOr ps4. De 1 Sip oi: 2S ) pa. : Qs OttLot gi b prt oot | AO LOG) LY (Resurtt) | Qe BP neta ied ae S46 ihr Oy 2 Le teh ty JOON 25.2.9 (Result) Btwirse shitt operator’ @ | Aetk shit ena oO i operand SSMS Cs Teh R£ cawce all bits in the operand to be shi to lett by n_pesition see's Gz 410) eS lo b OO: _@)| Robt shrét- operaddieen. TR causes all bits fn operand to be Wikies to “Efght by n position . remo: Let s>o sy (oo 1tol) £9 In put~output fr c. ushen Under usant a cnler data /tapu Value» then we have to use input statement 9 c. a |ditsplay statements ?n c- Similonty i ie Progra m trees “to Pp rint or “the result, we should we oetpu'’ | Taput statement in Cc. in ¢ ts scanf where form ated _fopet ne The most commoo fn put fun etion use) ie dercres, — Tes syntax ft .- Scang ("" eonversten character ”) # dit Le of Variables) % oe Renee coed v } : oy He read inteser no £ store i 8m vaxfable a). sk Conversion characters: - l fod inteseY e al she — float i 72> character ze F4 Date Page No, eS I ou le done float . i‘ i as —> Strin 8 pe eCard 20,245, 2 > it yead one @rtever Sf store ae ae er 4 en it read one Pleat and store _ te anty| z Heel. nee veads ¢ one _integer and, sore # ‘nel Bb scant (“fd \it: Ae es Ay es Statement tact: x ‘ The most common output ecto Bim cfs print Ae where a formatted output: j -Tt’s syntax ies Print £ (Conversion character, ‘ eee oP fiablen) | Q eo. print F(*/. d', q) > % diaplngs ae. Rilnben on +the screen. : repiresnts, 2 The another use ome pring _f) eo displa ‘the massqee: The Sontax Mis ee Print a Body a messq oe iz 35 | cee priat { (“Yello world- How are gee]; BE dope onde) Pe Print f (“you are ou i) (Note ¢ “. we can combine messace ust las the valve nop variable when printing, eo.- print-P [4 The dum isd. a KO Deefston making. . statements | pees | | — These statements are used to “make desatston about which port Of Brogror bolia ao t6 be Sixippe qi: Oilm ae ~| There are followtn atedionligie ds, eupp> Lyts decte?on maken > im cs< af Statement Pe is Simple he tf- else -> nested elge ae “3g (2) co o ndittona | operator E (S) switch wwiteh_ statement 3 so sg ° UF else - Beigiert ft fs used 40 make _dlectston on the | basfs Bo senior! Teabich is either tre oy alse a ff (expre ssion) Ae of Statements a as syntax fs s (simple _f2 statement) —- | Syntax or ip- els e staleme ns - RE (expression) _ Se else ibe ae eee e Qo 4 me ahatemicncts ah Vofd main ¢C) a que, Com ttoat ratfo | [Print + (“ Enter qumbers”) ), scant (8 pd ted fed fod 49,46 de, 4d); feted Loo) ‘ © | watfo 2 Carb vi et hefe €Y AGais . 1 Se Oates a Page Ho.—_] Ta ie [a ay (b23 ere) zz) i‘ oe idan clog 2,20, 4c ae Geol i =o) Semen aes) / ieee ee a fink le rete i ! g. Soe SL (mofo 9 = 20 els eg Hen: _ - prfnte Sie Ys ad 4” ae eeteh Ci: TES oe mie. =| Here, the | else? part of known a8 else. em dadde 1% ~stafement agate »checle the conditional JES syntax fs ex Preesion. Le (exp4) oe aa ape visPon on the basis a Division Dist? ast b inelude Be eae y2 os faclode 2 confo- h> as ova Gal icf ie _ 5) float p ct je aha percentage ae eo See Scan & (oft reel; ee een print £ (“7m mist fea e 2 tt (p>=30 ) 4 glee fe (PSe SOE (Pat (Seis iS4 DivisPoo” ) 4 ce Ww A second @fvisi on’): tas Ce = uo) Pot (S/n Tried OF v%sfon”)) |else E As ‘ a oe to read the Valve secu eNalvate e 4olloustng tuncion~__ mee iL Meo ———— O 0 Pee noe 4 u ae Be) As ott imiz oF ‘ah ) SS ay ce tw ent hes dae oe » as Scank (“Kefet fed 4% pm 4 -——— fo Compute. Net amount 2o ) ¢ prose tor the tollowtne e Patd 4 1 Oe Dis count: — Discount (O° Lae Sees fo 9° 4y oo e. Page No. Poel @ clode < cenio-h> Matinee.) dnt m- Pato€ ¢ ( net the purchase Amount” iF scan f (Kop. een \ 5 {f+ ie >300) 300- to 200 22 : Loo e inte CNet amount Ye Bs 2202 )* jelse 1% (201 2x 4200) 45 =e cE Susitch statement'- ae ee The Susitch statement test the valve of 5 ‘ven Nartable or expression aoainst q Se} af ease values & usher @ match 73 found a blocl. oe statements are exe evted. | Si sli. ial By Ba Bea (expression) Case valve 4 2 : us Block of statements + A it breqle ms Case valve 2% Block of statements + breale + ofefav tet - Block. of Statement | break « Example 2 Suritch (a) Caceeae. oo De real 3 Ye ot “wecong’”) * SS eal S es : not £ (\TRIrd ””) i j eo break 7 oo etault | o é : i, print £ (eat): breq ie ‘ a [Note $- aie 4 switch variable can only be either Integer ov character bet can’t be tHoat] wap that eds a value in +he ranpe of { Sp) . +o 42 and eliacve of rmontveumes Votlous! : 2 Name tan _ Feb Nareh e ide __ Mecermher Aurttoh Ca) Case ts —ptet £ (3 fan”) j reqle * Case Ze a Print | {" Feb”) + breals > Case Be ie Paton Gat! Moreh”) rect LENG Prfot i: Gi Becember") a lorea le *, wth getch Jee 1 se Al ouchavl Of cwrttch state men *- Date 2 Page No. caleulaion : Ain ° _ Youse rent Allowences| -Entertainmedt oe AiGio O14.) Soo] +650 sop 950 =a papers vend ls 2D + Entertainment allowences — j Use of switch case statement: _ The suttch case statement ts_ generally used +e design menu-dviven program: example 3 Wap to Replay. the menu ee erm the task specitied by the particular e@ption sn she | yen: us a ei | aE Q. dubtract ‘ % 3. Multiply 2 | 4 Divide shes \ Eniey yous chofce | # nel ode st ek LY Pndlude 2 conto+h> Notd matn t)- Po ( Riedie dtoct a,b,c ', 4 a “ Arithematic calculation Pree ra | frink Wwe Add /n”) : priote [S2. dobtrad/n”) printf ( Y 3. Mu plu fn ny 1 7 51 ae ia Page No. [prior P (Ss exten) i Paints ( S@nter your “choice” Seang (“pd”), £-1)4 vaio: ae ete” @aae 4. a __ Print (“@nter mene cy) i a Sean P Of fig 40,2) 5 i n= a+ bi‘, Print PS dom fs > FC) breale*, Ogee 2% | Be at : aint £ (‘l@nter numbers’) | Scan F (“ ofe C DPE abn ‘ ez ai tee : sa iia aublaction % “6 27,c), ‘Venter oumbe 7s”? iweaas £", £4 fb) 4 Cae rink i ean een ie fin 6) £94 6) 5 Bib= pot eC aoe by Zero 4s not tine) else S$ a e o | deka ult’ pee % x Yiurston. tas z break * |@ase St. oe print £ (“tRanl« pou”)! heals x fle (“Tawal?d soe ee ee a aes Wap do clfeplay. Menv £ Price, of Sraapcod -% items? fo od tHe ms Ay Syahemn 2. Savsage ub. chourmin |S exit Zz Ynelude < atdio: h> feet include glpwee set of | instrectton ve petead fy ae need +o use 9 special featuren IKnown Cp feopine- | _C- supports three oRindé = ee ¢- Poli: ep ae Wo) Gor oop a ec ae (a) do- _ while. Vieees ee __ +# | White Aoop Be | Ee fe entry controlled hovp =| The. condition jig che cked “at the dep a ah the cond: oe #5 troe , the | —. a rrtax t- while le Aco #60) a = Ko i * W_Teerement / ——- of leep_ vel Ga Tn: ralfeed etth Saree valve 4a. i eop Vavtoble: _ Gi) Check condiifon iG fobtofte ie it Never lem — loop fs tinftes al aS) Ono. only. veo finite foop. Example'~ sont to. TE Bin 4 ohaa Aas 2440" a fede oie som of Naty 2 Nombers 9 _ ; ir = S= 8 st whee ¢=o0 fl ° 13 es i) a | Priot € CSeom a5 «2 d= oie Beich ( ) 5 Be LOAP to tnd whe Product off BS} ixsxs +7 ----* ——_Ustng oop 3 S0t* = Dt toclude 2 atd?o eh> _# totlude Ceonio-h> Noid main &) 4. q yay fe WAP to tind -the. product of dx 8xsx] Using. Joop, where n ts entered by User a2.) $ fot iz4 1 P Boni; 4°) Aste ‘Ovi (Venter an numben”) + Bees a yy ‘ereduet et of a 3 = fe ong 40 ing the factorial of giuen oe ot (ute: factorfa| of ne (x2 oe Lo Scan (“+f« 4% teahtle (f2=2n)_ i vane Bie cme = fg = entry. controlled {cue co contatns all ome elements of feop i tas tag 1 single wipe ‘fo Png, o£. (rerame epee For Co tiitzation | £2 x3x - eee a a We Qa eos st: ee [fe inclde 44 Snclude Vetd main ( ) cos | fol, Pai d- Pant 2 (Center nombers”) + | Beane (8 -d,) 20): : = eat Sle 4 a Hea Ds, tH) TT Sane 6 Com ie _dactsriad 35 fs id A Somme Setch ( ) + Sal igiete bet? for 4 while loop! = : foe Loop en foc (emg §esn: ieee a a V e | age No. Hl | 60 | Features ©. fon’ “Qoop't i OQ) Mul tip le le tat Rzatton . be. “used tn in for or loop. See ns 1) a —@ ftp Siete mee | can be used fn Pocre me- (/ decrement section. Jeg: For (124s MA =M7} he n42 pen @® | Tn for Roop: Any. section cam be orntited. _ le oF) - 2 We camnes:S F for (§3m = 4005) a Cs 4 ; x ‘Vo S ——}__“Taknmme P=m, Pes a) Amt een A powzys al ntl (entera number ”?)* p geanf (Af qd’) 421,49) ve for (mao, mesy smitty) nf a §eteh 5 a ee > Tt fs ext control bo Do- while loop $- op: TE Cheaks con dPtion at the end ef the foop: Here’ the body a doop 's executed at deart one tne. ‘ | Rs Syntan cue do Bedy ae ye User: Rt eser enteve: nomber terminate the p Oox70M (“ Enter, ae nd” a _Som = Sum +N °% wap te do +ollowine Wace user eer the “olke ce e 4 I Bw A ioelode < etdte-h>_ while tn 0) Print £ (The som ot “posihive, numbers tfid 5 sempen)s 5 _ 33 a Getchl Dd, “vo 4. Add 2. Subtract Si NMohip) 4 exit Hf include — ca - Print| (S4. add a”) pent cS 2. _ Sobtract/n”) 5 re Prin (% 3- rao ltiely [a)s, he . me CXq. enit/n”)" : nie Be print} ( nter your theca); iene, (8refe ay ’£ Chotce )*, : ‘| Sariteh (choice) ae Add break; Case 4'- Seb : break + “Case a moltiply breale’, cane 4 | exit lo)5 inelude 2std?o-h> [A Sncdlude = Conte: h Noid main C)- i tt iA Eb a: 4 padi : Prin kt (“@nter any num ss Pc a a ek aot ESSE 66 (cy Page No. ) Sumpiog. ee of aiOae rom feop worthout maktoy the loop i Thesnat fon alse, %s Icnown as omping- out | »¢ need. a t femntnene _doop to b Po_beth boeaae: 9: Te do 4 hfs we vse break’ [St cement Rone a eee. | | Syettan te b> Generally, pene Sabena oe oop a with 8& statement: | Smample' a Whe Ceondtifen ) ae i We ne lexo) break e pri me or not: _[Ne'd_tmafn ( ) “tot, inl Moa 5. Pots (Mt CONE Number ee 2 Geareb tS fed” fn)’ ae tov (R= ee i —s ante ( NoPE, Pp Number ts\ prime jiiad else Bp Preat 4 (“Number fe wt prime?) }* >| As pile cc). in ste. ie a ° pat on bedu Tle syntax ies A PA eo) Tauatiaaibe pesiove while (eond?tfen) a i — ne ‘Darts? of loop %% (ex Continues. Bie le os loo Pp é [elecwe hart &- . x. Vot d main (_) p ° om Sot Ds eg Fee 2.8) Priott Center @ Normber Scant “fed ees Ie Deck ("Ne cormtinue + Sean ee e257 0, | getch OD; ‘We q Priotf (The som = Nested oop" - When a loo P while (i24) Sees Monies Umea) eae Ss print (‘nelle class ») tts ; Ror tl = Oath toy i + I et (“vello class”), iG ee [print £ AS ip fe evber-leop”) Sm ee ee 2550) — a fe so, yt) ae i & (yad\e".p)' vastable: Bet when we use array, Me similar +3 pes ;we need to vse @xample!- Te store hundsed Pn i simple way ;we need to declare A Hs sored in single array. ne ear be declared ao: : ‘array Name [dtzey’, IbNobe:- Array. size {s always Snteger pcomesiot ¢ [ey —> Tt cleclares 9 @ : with size ‘s! de. it can store §-% Pxample 2'- Declare an array. -t0 24 loa tine Point numbers. ae 4 J oP Gite sree= elements fn carry are. stored five memory + alization of Qrray %- =e HK assten @ntfal. valve [elements - eo"- Ant atey= Que 490, 3/45 oe Int Pies 69.8 18.0) ea ae Ee temanine er. will be Zero — BI ew +o Qccess Array elem ent in Cee 2 The SlowIno notatfon Is US ed sto Access he pslemaris of given _Gyrq are, ees. mine, QOVUS |S j dithen, we @ print hase oad astoe| a ne ee tae pees) a S+num (as | ® Petott ic re dor %s ‘- ao 4S) baste ee 3 5 : Print £U enter nN att 20] nem emalle for Ga were 2o* alte) ee seank (“ye d?), £num _ iy. [ginal = Bee eetth ( ) ’, | *t fa (J ¢emall) Peeemall- 4 Li)’, - gtk keno s34) [Print + C\ The Smallest %s + ds small + 4 fe to 16 ibehunce the” Search fe searh fs suceacbul: Sample 2:- Aray:- [20 | is | a0l4ol[e| key! 46. Then the key % not found Im the whole So search * unsucesstul- | + Void main) ae) | It | ined (801, ms lcey tag 20. 9 ut ia Prin’ ( aeiles Aer ho wo Mang nomber scant ed", Bn)e oe u as i Pr net Enter Numbers”)s : 7 er. oo Samy ia ‘ oie % 7 — oe a fod 4 4 a? > un ee a 2 13 feed Enter earch #ern's")) am Sean od 4 key) § a ee ine t Csey =a Tig) : ‘Psiat fC the key Hem te Loong ree rs 7 5 3 MN Glage- o) \ Perot + (WW The Ptem % not found) )* ee FS etch Cs * a | Sorting: - SFE fs process of arra ——.In_cwcendfge. or ee line Ge Soo 1; he key, flag 20 ° c Pro € ( — man aieey -¥ : di Scant (* apd, Penny. inkt (enter nvm ere: », Dees & i. Catia >a a) fenps ST Ste Pe OG sees so.» dain a {i} = te ie 4... rt a | — iprintt (“ The sorted nomb¢ for (P72 0" tems ieee eee ty: 4\£", 4 CPI)4, © etch te} x, La =||To store a table, we need ao use. rag

a verd maftn () [char 9 CsoJ , bCseJ ,c Tuo, — [scant (“fd 4: bof 5" iD) biG a aa ey ee 5" 4) bye — _|ueben new LMne is tee puta [stving. variable ) — [ieee do read a The alternafive vocton Se act Ai) usedate nie atch otyin 92 com plete Line ob tent Tee encountere roe gets _(atring variable P eg'- gets. loame) +, ushere, chase nam Stmflarly, we can print Atriny eA using puts © tonctinn- Agra! Augite dtinos’ i 2 eel Esto he | de @nelude Acon?orh> 2 enelude CSbrine ie ota. radiate) we kes ae eae har 4 (sot e Oo) ets Coys ee Bare 6) ee ae ¥ utsa)s : ae “ Misia: toy) yy" tee poms tig) Gang © ‘ ‘1 yew WAP osine Set char 6 lon clara =— la “Afoe ae -] > TS INeid mata C ) ee es ae char dine (ise), chy, ORES ia a (“Sénfer ne ot tent”) 5 = ah = Setchar (jy ‘ ~ Kine Ga ihe = ch ae Se | a J, ee a ed hile (ga cs a =_— ee eh 5 es oe} tfne aiats = _i thd ja (tne of tert eee ay char name (lool, , acon * (“Ys (A\n J", name)s Bot We _vrorely Use hiss Sibeee more convinent this task - B >| Strine. 4 “7 | Rat Yt Ry el Pr? nth hak vs {ot dstving’] 5. | cets (ating che 3 et 4 Mi der ti: ©; String 4 cry £\o%; i oe el ee at ee string 2 Cys string J ij ET | wap te c°Py 2 [string £ TS \Ned main ©) wots sole LQ Ghar string! (1se) , rine 0 Ciel ehy Biring =Hondiing. ee gees a copies one i _|} aadons em comtents ok sty2 40 Syntax is s+ sa _ Stre py str, sky2), ox (ard ‘ushere both Jet £ strd ave string \ |Slreat ere Bene F ; E Tres eee Jotns two strine. towethe ae ts" oa | | letra Petre are o Jntrtoe: NarTable- | [otra] * Skreet hte ok 2) “A Mere, dtr 2 ‘ic @ ppended £0 stra, ash ‘example! tra = gam ie a ee Geeta’? 4 “ren _ throat Latr4, dty2) efven & Ramge [Nete + The wesultant stn 5, oe sto se Tuncton=% Soeeae j istyings. — io i eee The wo stvine ashen compar Stremp (Str Str 2) fe © SP ae : eqbildewps “Han Sw aie Hp — re a Ses . _ =| 20 *4 strt fs greater than tre. Bei 2 0 tt strd fs jess thantaupoe ae: finds the numeric value b ndine _||Nomerte dP Pere nce between Asser coded | Rndividual character fn the strings. : lo Pdo dhow all Hese oline eee A OPS — al H include < conto-h> Bo ipus (hey bos | clvces (); Behar str4 (so), ctv2 Tso, —_ printf (enter a string)’ Beer Gets (stv t): lusin 2 Ribera ry. functions - | # Gaclude = std?o.hs Vet main i) strc p (etre, sir dt) sent, St18) = sao a (ie! skrin ps are. equal); a ne “puts (4 airing eon equal’ d Lgetch () 3 ee hay str4 (seq, s etre soy; | a eee (ents aaa a atring” | gets (strd); [gor ne OF str i (1 | Paty. [i] 2 Soran I sty 2 Cijc Xom Puts (sky aoe a geteh C5 ag || wap to Con caenenes iG styine (usthot | peta 5 straat OJ a as 2 ga * main () ‘ _ ‘|. ste io za . |c . firsts, atr2 [50], tnt | : puts (stirs )e getch Et)" & ate 3 C= stro (7) Sora | Str Ci = No wap - eae copy, concafe ate compare [a ei ram - a : pep _ © eount He dongh of amin oo — _strdon tool® re ee ehar string (sel, : Pnk to count =O § Vous 20", gets Print + ee enter a string my = oets (str) ae ___uahile_(eér (14 | = “Wp Safe — oO a ORE . a ye 7 _dk (str (it== a (== Ae __fistr ttc 2 |] ote i) 2 = St [Pe -'0'| | ete (9 ==) 0) |e st fil= = \U!) = ow | : : be else _ = cons" _— art | eee \o Number of vounels = ° a print f HS \p Nuro bey of const =e" c geteh () a > ons a it ry re et Kibrary, funchons are ready. to vel Aue uchich are already eal ceded | ae there are-twe Ai ’ pes 6 fife unetions 2 “ff | User de med funclons « 22 ned fa the ¢-|Pbran = declaration c ‘Tosergit valent &. ge a Sefied fn header tries &xample:- pow) sqrt 0), Sin aad ie Se |= mal}, h> es —_-| Strepy Ui, strlenl) , streat L) ete tn <¢ ho | a anf (), ‘print \) gets Co) —_ i: ae a tt —————————_— | Qser detined function: ae 3 i ) Sealift fonetion wuhich aie ustfiten /coge Berea ram Mer nimselt , fs known ae Use4r- det! ined foncHen: a a. | cE dunclton £ put {4 fnto di becomes Library. fonction: — Te convite fn ovr Pregram fe he follsasing ackfu tes - el (i) tunctien declarafton | i i Ton detinalfon Functon call BLOG Fonction tyce (eahsro) tot of rameters Cn put S & i +} Aocal vartub le { halter pad dec ara Hons a Crefenn: “Shale nya. Giements of User~delfnead Pon Pa Use a user detined " \ aos rammer sheol mo 3 action dettna Fon fg the ootuall ene of fonction ode fnclodes | Fnctee Name decla unetfon name |» Ee ue tf Wap to add $0 numbers include < atdio-h> ——_|_ print § (“The wom es Meee | tebe 0) 4 [Sat odd Gata? | tat Gi bey cag of sean £ [fd sed Indude < cont | int_moin () 5) a. j rint f {i @nter an duo nums i Fa Bb), G2 add (able pereturn, OF Cosas not an a wetusned or not, May be clase? Tonctons pas no ‘arguments 2 No t Funetion caetth” arguments Noy S Gl coe ust Hh arguments 2 ret | | | unetfon usith no arguments but ss | otd. mdn C) | 5 rint I ©) i Int ne © | belch Soe a. Ta 1 | i | | 4 Noi simple Inter est — r | Notd main ©) | Sloat a, 4) zo [wap lo ff > ‘include ‘ Prin tf fe rai principle , ace sate” Seanf of i fa py 7 imple om i oie etch ey Ha Notd simple Tote rect (fleat p. fle A [Whar cotog f fonction £ also retunid back. +e Kat zi unchon: | Sxcample!~ - as WAP to 4?nd the Simple Thterest. ff Include Such am. oe —— $ : = : ents Parameter but a be ito callPne fonction: ” | fief One - uray commun? calfons wv or ais on der control ee ~ — qorober 3) ee es get- gomber()’, Se ee Print f (6 The. ace is. e6 hd? ” 2) e __getch Os, met. PR : fet getacenterO oe / Pot Saud, a |_ print ue Renter “numbers ay scan ene d” fa) _| rretuin Lay’ be. wap do tnd = som, sobtractfon -on 7 +wo number using. follocs e | OR +. ae at int ¢ub ren i Nota me (int a simth )5 . tuto n Seanf | ee a? fa 2b)s* 2 9+b*+ She Got Svb (?nka@ , tgth) _ tot fa -b veturn (21) *, 4 Vo?d mul (iota fntb) r ; ay +e ae Pitot £ (\ Somatfon ts 7. aes ¢= gub (9,h) By =a SrfotP (Sdubtraction 2s pte mul (a,b)% oe “a getch 0) 5 Co an t 2. iim Wap +o bof pa He mean of oven ee i using DE ction » is pea o WAP Te tind “factor of given 9 an om toncfion | a i Ss B i — —— i ————— Ly _# Noe * EeKecurston _ might [cee desi recureive unchon , use shoul 4 ; ecity -ter minatin g. cand then [Example '- WAP te find the numper: jetvyen I ptael(n) = nx fact (ped) ~ fe 9h = (0-95 4 fermeingtine condition Beiideclude < ctdio hd tot n= 5, f5 Beeace 0p) a < printf { ¢ ieactortal 1 ia qe a os Seteh = ee Scope ae v dail iiily. 4 \ietfme od vi ‘The scope. fp aria ble: determfnes ov >), ees of the —. a Varfable | Bs te use: | The peer: or longevity vvet ere a Lo during | woh th 5 variable retain ohven ve Calve) eines visibil? itp Slane to. eo acess +} 9° ae Sane i of hese. exiterta, v be clacsitfed Into [Marta from memory: “# toclude fnelode < conota-h> fq _main C) E |4unction a elnele 1 7m _ neh D| Passing Sap Tae elements of Ar — ©) Passing uahele array. + bon ation —| So the Po ncthon a f BS idlemenk ( Nok he ushole 0m BS wa 3... 22 Fosding. Array. te fonctions ( . apaee ean be passed to) || wdays t= my T a j- 09: ier S } Pasting. Qnclididual elemenme of Arca |Here the clement ef one fe. pa 4 6 The eceming element ing stngle Peed beak (Ste cemot toy pee Oia 7h “ph u | Preoth (“tne 'nevemented valve | Z ‘Panstap shoe Array 4o dimche z | “To Pass ushole Toes tnto fund : tne Name of Overay Tn callfine 2 — >| dined thanname ef array mogl ithe ac dress of test cee the [#5 pansenfie on _ > Mence: the recefui 0g. [tt Sato an =| Calblfns TK ts osed +o ied dig. eten’ sinele entity. (Ana is group © > For, example: “TP we heve te stove User | program can detine stro thar requirements: , information of many students : Q) Name fs = lb Roll No- i 4 i. Address | PePinine structure '- eH Uar no. sy metax as!- | ‘a Then, we debine structure ushieh INariable as members: | In thie ste p, Le detine 4e ecture such os its name 2 ite \members _Struchee structure name Beta e ‘ype membersfs Pdctas type member 2° _ 5 f data type member’ is. fot Gil ___ chor addwece Aes Gos Decla rin: & gheucture vorabien st =||Rekore usine. structure varfable, we & declare 8t- “The syntax %! i | struct 2A e Nome wov?eliee " Fer example! et tre ct ictedent Sit, Nam #| Yow to Qecess _ structure mem bene — [fo fo Occess Dies. Member: elements ot |eoe have £0 _use det () operator ero | Vavtable name 2 YS member Name | {| ferdele nf folreag aia this structure, Wap tovead thie 9m ifrom leey board + poled the sa Sereen’ 251%. ae Hf fnelude Zetdio HY tad fnelude cconto- b> _ Stroct personal ¢ Yaa ae Name a tat peo ie ¢ a month feos. Tot day’ - oa ed flool salawys, z as drm. Oh ors ie oy month | [Senter salary”), et Sop fy doalary- £ O\o ops men ‘fed of _geich U) 5 4 & 7. Array. of strocdore !- JWohen we have 40 store many records Comm — “nstance! pecerds of loo ee then , _not feasthie to hc doo ind vedval | shochu variable & Process ahem! : =| |The sol) % vee a array ef stryctof e [7 “Tt _cleal ovemMacat ection of stiwet i | Vanable fn a of 1 example Stroct stu ~| Thre statement declare the a £e store the records So S Simla wy. technique e c rray. of structure as we have 4s lef simple array + Sour exam ple*- Struct inde Tht gol Ly | fot seb vu eee ge ee | Then, stroct mark sts]t_ > | Then we can accese +he tad tidemae students | mares ap $ (oJ, sub! 1 S fol: Sub 2, sfed-Sebs | for ficst student 2 so on. [Avra asithin structure 4- Here ,ushen the member of aig etrocye te as _areqy then it ts [known ao in structore ~ F Gt sub CA)’, ioe otal’, _Notd main () : ieeoce _marlés S t=) Guisae Ten k 2560 .Sh 36aam Stroet marks stortial'». H “Student (4): total 4 ocenda” ti eg _ctetal sub (i) t= Stodemk i total printf (S\n subject Mebalihal _ for (i=0", 414 20 eee ia Ae |We can deine stryeture Pape h (objec ed pd fai pitn\ : {& Grand fojal = ° : gete ts v ; 5 aside the definal lanether structure called Nested struetur Sumtax!- 22S struc Structo. re i lesa. kype “member 10’, tu" dota - fy pe_ mber 12+ Struct shruetore Name ws ome We tee type member 245 late member eae a ae ey : as | data type Member 2, a 1 Pee “ [__|@jamplee — ae 5 trod student 2: Se NEN a: / g ae i lar cane! Renee = ete | iceeole : i eee e ee Fok ears a ee Sat mente Ste | ots co co i 3 : : ‘Now, we, ye Z lass - a z — access Ure ‘wembuel oO! S$ name iss a I ae. is Nene fo) oh i | 3, volley Vall ae kudent m oe d. “yea Bien a a 3 _ 8d. month h>menth eS ag Struct Dow eT 7 int months os © tae ‘dap ae ‘ cle aa %, “ iiakd ce - struct, student a =\hoee ie ae oat S| chor dame Gop, struct Pot voll’, ' 6 Struct Dos di; Get 7 ||We can pass - uetng- ollocwetne methods 5 : £ the stroetore. “Rate the Passig- eo orembers ° Bode fo mts: yoll)*, —s vectver 1 ee eh | ee _jeahere 6S FS SWucture Vavighle: Rectever ton cHon vofd fun a _ fonction coll + te Passing, the : See strvclore. tee r eo: i fonal cel] ——— Verli ton Cetwet stodent x 2 Biiloos) oe Gil Ris eae TTT giscsss the elements ome aa Vortables fn me eee : ve a streclure jcach Dumbers has Ws 2 decation ;athere as all members Use the same lecations - a Ab ough a wpion eae contain ma Sia actors aunton fem 2a variable © Afo shown the memo union “\ PLem?? I }oP grat erent types tt can handle « _| Member ot a time. : j 2 [Example * - On?ee item = code’, 4 of 4yupe unton: The unten contain three 0 “each with di Mderent deta type: | gan Acces only one member cat a time: = ia [ay nites “that f we use { Pay My oo “Cede. m_~ +0 access (m? code. Mi — Sto} 8 > Aa code —% 4c gecess When. tee. worite £ louring code ta) Ee = 39 a ; E eode.m = 895.30 i i SL prtote iS, f dean) > gives oo pri PrfotP dis i pre) > 3ive Nala 40 pate of atructure $ - 2 |The actual size of struct vorabla fs, som of the ize of indfuidval _membexs’. fer example — : | Strvct Hem Wnt m4 || float oe | th ar cy th codes | Then, a ae ¢ variable ‘code! ean b IED using Udize ef’ ” operatfor, ag!- = Gre af oda) ae es gives the sum of size jee all three members Cire) ve! wets “S dtceves the rep in Memoy> + ~ aah of [0 1 <— Valve = Seco <— Addvess am Compute v memory as. Sean a # f memory. block wrPth off penal | mee | sccl ae 5008 eo! ooo t fe: \ Lemorgp Layout: ey | lw aot ‘ts pointer 2 ; > Peioter spectral vastable which hold ‘te men f another varfable: a yess ¢ wy a on 8 rater var?able IC S =| The symtox of pointer variable dee as Sax Suntea x *- = tte * pointer - varttable 4 Ee Osfa a nas Velo We can folie. otater warfo be a dd ress anomner vasta ble: epe- | tot saul pie ED 7 is access ae valve of € quant 4 using Sie we use ostalio as prtote (fed * 9), a | e a = fsa 449 ; Note 3- ye painter- -Variable — ives va \ Hee? w) Pointer- variable — eives adq: gi- + P > ia (Valve) a Pe Boog WAdaress) _ t quantity —Natiable -Name = \walve - el rae soso me dates jh BH SOP FH ee ee og er Pn, Pett cS Prt CS yrddress of print Pes address 04 Pafot f Uvatome OP c fs 4. PrPot f (value of a %s Be prioth (fats —_|prin te US fed ts sto —— es we es i | 4 j fesencrh: pty s ell pane (\Naloe ef mts dm) @etch cas 3 Nota main () hot meg, Y oi pie Po all Eh PLS 4 oot addy [4a 295 cat addy UA Ln # et addy 9 UL EDI pos dt addy 107 449) a | eee [priatf 4d ts store patot€ (C4 Ie stored re at +o a a argume lusting. address of vartalele called odd? “< Halbed hen we: pase. the ade lyess P Panctlon 0 peo © E made Sn : Gallo 9 - fen Ton: on Example poral IZ inelode. aeudte. h> Volt ewaPp Cint x Pp. Sot #4) Voigq moin C) bye lade Sa ortgtoal varfable /se fonction alec etl int 425, b= 10% | swap owe: £b)5 print £ (Sef \t ed, a bs I ea (ee Joi swap @ Poh xk Py int *a) ie femp j a temp = AS Rae. 2 se tt t+) dot | Tob volt | char name (207 * | Nerd foveal) ——t —— || i ee student 8, pe ee + yi) ‘Print (“enter Name Co scan? (th hs’.cinames)\, oT print i Scan Center and structs .e! > We also can pass _Cushfle) Tete a fonefiens TH fie | address. In this case we need to to structure fn recefvi > When we used potater ase need to vse 6S? arrow operator ‘inte Eram ple '- Struct stodent re the oddrese operator: Ace ie (Senter Roll no’) QO qed 1, s+ roll) a _p>voll BGh a aa _| Dynamic Memory Allocation: - _|poinler -to allocated memory at run - In DMA ,we can get the exad stze | Nollie G Tt allocate requexhd sta The proceas of allocating. memory time fs known as DNA: The array fs an example © ons at complile +fme ushere os Om memory that we need fn our jebtictently uses fhe computer Mme mor = ° [C= programm?nn sepports follouring = DMA s ae | Pooch en Tasle __|| Pretorna ef pointer mem bute of gllocet ¢ Colles Wocgtes spqc Alecoting Memer UsPag. E. = # {At S noe fen ao | ptr= (date type *) mall ec by e-Siz Beene 2 , - = mz (Rat 3k) malloc Cloo * she off b) Nit pet (fat +) mallec (nx size Of fod . | eg t-D WAP 4o shores h- trie Nomber d E ther sum of those nvm bes veing DM ' E> # fnclude | # fnelude catdiib:b> ee || Noid mao L) tot 95 ¥py | prion £ ie Enter Hew roan Nomber qe a 4o enter saad =| econt (4/4, Pr} | p= ((?nt ®) malloc (9 ¥ dire Of Ca |) S295 ¥ (pri), Lt S eo en we ay em 7 4 nf The som f= /+4”,s)° 7g ’ _ gehen? cmeee 4 un, | [WAP do_alete o-nomber § sok, lenge Oe IG ty ey aaa Slaven c there awe can Sto Fis =~ Ready deta = S tote 4fle =| Case ee e——. i K fle in mn ty. we ose “medet fs : = om ve. read Or both peed reo} sie only opens. exfsti no. Sfle Qs —Urell gs_ en : extat: | Closin oe fPle’ - See I Syntox ae fctose (fp) 4 fe a | Mere falese© fonet? on ile aa fo! fone fe. palate Writing ato CF jet a Spot: aimtlar +o

You might also like