POPC Complete Notes

You might also like

You are on page 1of 60
Patocip les of Prog ammfng Using C Agoritheo = A set of shaternents to undecdond. the legie olp.=culpul : ifp_- ‘qpul | | » Dtepla Hellow Worle! Step ds Stand Step ti Patol" Hellovs Wold _- Slep3_ Step ___ —— 2) Read on integer and disploy “A ____ step 1s _stark ep 2s Recaol fhe Zokeges: do M Siep5.i Paint the gn teue M Step 4s_Stop 3) Add juso numbers dept Stout _Step2: Read dheficst_oursbex_os A [st 2+ Reacl the seconcl number as @ ep ae Add A686 ond ghoxre in _¢ C= ASB = Shepd t_print c Btep 6 Stop.— 4) Cormpuse 2 nurnbews Shep ts Stow eet 2: Reud thefts st number. os A§ Step 31 JA 0 VE ADB Else 1F ACB Print Bis cascades Lote Page "1 | ELSE Piiol Ny cane equa Sep bs & op. 5 Wile alqesitlonn to check The aiven ounbe . ond on Mo 4 be - Aap li ote Sted) Read dhe murrybew as fl at Step ts Ht AAD Oo Patol NV ds owen CL se Patol Ais odd Step 42 Shop i Pre Processor Dinedive ag | shader. —febe Wincude 4 iol Si . _— {rood Wo Yi | oil matnt ) Sup hot ) a ie o- Jersatoatt— 4 4 Witte a urea 40 oink - "tH aa ~ |p tontade ‘ate, b> p 7 law sade wi, pnatnt) \£ [pte C" Mellow boos lel”); | el by i r ey Whe a pregaana te -add 9 Anteqers._Caleulate sun 4 _thena —_§ display the same =— - — FLO CHART. == Redo OD > steal / Slop a - ff = Reading vont 0 -the—data—__ — ters ‘OT Tnstractions, —— ] asstqaments7( tatirati zeod 7) = ——> Conditional Check 5S Flow ¥ contro] Date 77 Page: Orow -iflous chort to add. MY urabess 2. Brow a flow ‘choat 4o add fink 5 cnedoral nuicobers = sf Té5 False Sure = Sum +7) t= ee — Stradare_ol dee C Proqroue “| Header files : EE sidioeh => help us do cassistan- Sropus- epee 4 Nn operate moorenoetical punct’s. -help_—_us_to_opexche tore, etna a a 2 Preprocessor Pteective Statersents? _ 22 Glebal Declaration . | Stm¥ 23 we CIF a= cnet 1 AUC TF void _funetida 4 «> ft bpcecleclat? . j : i i 3 3 o arotch ptt? 2 C9 ~ | £ 5 5 a > Part prounssor clixeclive #foude C' Before swapping’); priatiC'rd za”, o.6 95 Date Pag} — Lemp = as : Los b; os — _b=temp; _ print "Ase \n “AL tex Suoapping") 5 a ; — printf CA ped" yb D5 wo : J} vaanersuar eee =_> ‘Tokens dowel iE \ gondliitonsl ee else staternents wefurn _ 2374 7 = : Bae 2 4 Page Morrfeulsles - i 9)-Cannolt be a ax word 40) Canno} “tng eth specicul characters. except | Cuncler scove) ai) Canmoi stort vith — digi }s w) Cannot use operetoas do. special Tenn ae 0 Cannot ase consecutive — Medesecole Ziw9 «scant 5 Chall do fund") sede veal the cote fey > acbcly ess kectboard . sean pk” 8a) 5. Li type of hater ee Lee met ite “ot jit to _olsple. — printf Cvd fae ee fetch the dato Q. Podaty pe Size Chor Z i8 4 Byte = 8 bi 4s. —__— fot ZR —9.| wap “40__dlemonsixete “the concept of aattheneticopexctbea 2 | 44 tnclude a floc a,b 5 a | float sum, cliff, product acm 5 — phot, C" Enters the valut. A a 7m Sn" —— seat (* 1g 14 ” Boa Bb IS , — Sum = a+b} = — “dit = by — pees divs op/b3 beg - ~ rem. = a%ebs5 : : —pioif sem = a6" suc 22 : : bi print Oiterene 226", olf )p E -paiotd C" Product = “eto, ONY on = tf Atv) ee | “aie L #_Sum_=1 Le Ditlerence= 5 Ee Product = 56 - Division = 2 = Remeafoder =o = Ena pant nf a ype y £9. sum) > Bde 2 Page |PobteC. ee sin Donde Me WOAP to calaulate the GP Gross Poy CGP) by using the Wforroule _BP_-ADA A HRA. An mee Basie Poy (BP) lis 4o_be wea Aprough « keyboards OK 4s U0%- of BP 14RA is 20% of BP. pete —_ l#H]Jicxlude—_ _i pact J wordnet )- - . po come rach) i i _ float _@p.top» dota — 2 paint (Ep tex_the_employee's Baste Ray (BP, IN conf'% 4", bp); bro = bp*Co-2); : _ da=_bp¥(2-4)5 p= bp thao + cha; jo poss Pay (GP) =" £\n—_g. = Pp <—$ dpuk ' °. Pp, : 1000. The Gao: Pay (GP) = 1609.ba0060 —4 a >b —~ Tre —2t ash atb — fal — © Hsincludt : woid imatat > . 4 i i Heal jot. b, 7e3 | are ee priotf C! Ente the values ef a gb") - Sean (" Peli" Bo Bb res= arb, — 5 prick C uv ds peal on, then — “ping (Reuland ae) 200), __lf i: ge Gas O=26b> 30 as=b ° | Ole ——» 4 —thandludle pint Chol >= zecl) = “veal” oy ene ee rd <= took) ~ 7, a 9 Hic agp operctlors_ufth on exe a _——— — i OQ = 100. @cD bt be=c) _— fas cee 1 o © _ © 1 aT wth Table | 1 ei # znclucle &stelfosh>* oid roc i, L Sat _o=100, b= as nes} = 2 Cac ves (a2 loa se TH CRPEY BEL REED prinl{ C'ed\n", 108) 5. yes Care i (peacdy pried Cdn" aes)3 ese Albs . 5 ape 5 priobp vd" ves)3 a Spratt Tae TIC BHC IS, af oR l#unclude. ———— a oa _votd mein) ' ae ee eg | fot_eetz, b= 1o,c=3, 708) oo epee Nese a ee —____Lprff Crs == 4 )y, se - eee TR Cole grater Ds ie * —Q Bemonstrcte jhe taneept—of nats Qpesctlons ig 29 example 4 WY oa : =| omy Syesalon! ane! =) ae ‘La VS Chtrersent_ — pre Npe. & tata Kstdiosh> —> prepreessov dt ve clive clan in| Bld VOILA meting ) —— Exeul? Stands — ot void matinw) a = he a... CC . : st —- $ni_nund= 10; _ _—— printf C! Mole ct __prinl{C value i eevee nid". mune =)5 EE pri Molue &~-pum = 7d", == 0 oooe get c Value—ef nun =/-d", auco); ot a,b, xes 5 —o=lo, b= 5* es =O>b 7 1203 y Dat Page - it Ge: — —— os | prior Cees oe S —_—s ee i Bilusise Opercitons $ a a - ‘Bihotse AND & pve ikwise OR fest i Bihose Exon 4 > E | Bitut Not __~ 7 —G. vate the . toils e le Bihustee Opera toss | | | Bituofse AND 1+ | 9 fees Bite OR Nev vs yon - ihuaise EKO? A Bitwise NOT. . D| Bituise AND a2 b= 3. 2\3 a ©000 S016 gi- b_= 9096 901) — co b a ae Date _/_L Page O000 9010 C000 ool! R800. _ Tse a ee — eee Weta = 4111 0000 | MO = 9000 jILL = : peeing tort ft sto sate | + 8 ere Qo 1 1 2 — Doe Frotdere Pt + ——— bSf4_ Operator . < 5 ae SRIF Operon, csr ggntreat Be CTSET | O<<4 = 9990 ao —' 6 ase 2 = 900m 1100 16 ——___C lett shift ee oe eee al = es 00... Ooo Regis Shift Opeverdor _______ cs a >... bee oo 00 Gl j1oo—- i, bozt. = Ooo 6 oO an oo ne p.»21 = 600.0 _ao)_1 | _t—» 3 Cksgh shih > viding by 2) oe a Asignngent “Oper sje. ——_— ———— | . Ot = 35 ee ee as. ee a step Bae Wille 6. _pyeuddocode fox coulcularbtg the nise_af_a— product “ler —adaltng the 2 es Sekement 2: 4 Stecrersent nt > 7 Statement acy Statement | Tstaternent — a \lock > Y Becks . | | | [iit | . pe t : I : v a +. shes e- include < stat void maine > oh ; it +. - ‘ . Sot nun: IpxinitC* Ente ws contro “Yfrure); printf Num bes_sis even"); S£Cnum%e2 ==0) else— ——printét'Numbersis odd”), ate — ah x» | Stodermment block 15 | _ _ _ dete if Ca lest sxprentond th eras iC — = ts — Stakensent block 2° i else _ Statement block 8° a — Oa ———— —____ Minclude_ — void metint a —_——[Snt_azio.bzso; 0 ~ _-__ EComb) —_ > paint Ca is_greedes than_b*); eta Ba beet ——_else Sf Cacb) pint a a eal a else aa O_and hb cuxe_equal”): ——4._W0AI ven “no. i ue. : eel —— we—ex_negative oy AHinclrde tolZoih: ay oid maine» - 6 Bemonstrake the conepl of —Susttch= case statement.to check _tecerd voor con entered —charere lexis oy nok ee ee sath OO ee Lous Chor Tue Stat erent block False TF ia : £. | block 2 et — + Fealse. ue aa 1 tt Gelatt -_ Hock Lc Kuler) = = Panes oa so Statement a Stal ernment Afinclude | pantfCUEpLes the chaworcter\n ee a —StanfC" sec", Reb); > tee) rH ie | Case la! pa Se Al prin C8 “eis ctwouoel ch );——_ > - Lose _e? ase Ei asiott("y-c is gy vowel. ch): ,, break: — case? L—. | eset ipl ye is a youl”, th): - breck> Case ‘o's __. laos ‘0% pabott ("fc iS _o -vousel", ef) — | breck; fae"? pend ea : | ‘pre 3 —————_eorxes, number pao dk jd eels Sr ee Date a Page _enclucle < Siclioeh> a 2 — wail sockinc ft Sot — pint Fas the do Scan{C" yd" Biclay), -Suaitch Clary) __— o 4 _ break: Lease “patotiC'Manday"); lreak* a: 38: pefallC" Tuesday’) breok* Cott cork * case 52 priatt C" Thus dlaas 2 eosegs breaks case Gop Lett tn Faciebasy"); break! break; defourlt: grtal fC" Lnyalid) + y a | stutich, ~ co youd ena. aes tH erselirde st chiro yoid ppafnt 3 iL chox—ch; oa 5 7 Sth ease 'O': prtait "Ou shard putaifC* Unter the gaodled— : leant (" pe" & gh) —— a “| —— ses | bak, Lose atta ®CP lent) . break ace “spat cle vey G eet) ectk | : case 'e'® pafiotd(*Goorl”); f lovecek case 'p’ priati(" Fat)") break ded ull: print" Invalid) ib ——__|__ooping Statement or Theraleve Statement white do while fo | pobile loop_usfth_an example § usrife 0 Ruchay, Syotax § progres ‘for the datement x + ‘ : vahile Crondistoen) it douke ment block \ Statement _ys Se weg ee Aleouschas b Istatenvent ral Heealoe- Date Page |S — ts Jo sl Seerneerr rae I eeees id eetemernby fy Date Pre @ LAP to. find tht Suns CT first three naturel — Hincludecstdioehs Mnben vofol matac) fea, sumo if ‘ ip fen, 1eemg fot Tet, gum=O} sum sorte as while (f= 3) i oer « prinkhC" rd 5 a Sunmr= Sumat te 3 - 2) i=a, 34-3 y. suro= 34326 pint Co Sum = Lol, gud) i f a oe a a _ jp > 2). kespie_do = vahile— ~Syota— ditensenl x __.do [staterent- x_{ 4 —| _sio\snent blocks [ L y woahilet condition) s— [| Statement block Date 4 — Page printed", £95 a> ps) jot fa 4) uohile C$ <=10 paiatt ("*"); feed yy y fox leap pees Syolox_ —__| Stestenoent C5 Leena test teat’, conclisiondL: Tocrenent /dectemnent /uppdate thalemets) if —___| Stfodement block; “sted uy ent 3 a: a Tntlietis at dtedensent seen block | | Ce loop vyeurable | | Se \§nt__sum=o, {* fox( $24; tee a: e+) Sunn « seins ts —— prin fC Sump = Yeo" sump BY Zin lucle Zsicios bs HO4 2 joid_mooine) 2) tet eas ce Weder 3) UH 2. er5 fer nop. include ¢stdtoeh oid rocine 2. £ - foy m=z 2s fon (Et Pe=10, 44+) fatal SC MAx ed = Prd Nol outa, “FIC pum*t)); a : tinclude (stdic. b ueid maior? ft Sot num 4, dock for (f= 2; i4=0u t+) fact = Laci “45 - pristC! Facloniah of ped = el", nurs fab 3 x. L e as a Module 3 m _—_——— Aree ie es ce the coltection ef homogeneous type ¢ Se tdatns i E fe lox. Av _cleclare cr _craety Ape Benet fem sto] § Le $$ 7 al 31s, = = _ Be veid: inate) ee rh _obtoolZ eens ——pioli Enter the size of th - Sean dB) * - W ara); AE Baten. She. ae 4 anes) a et _ for (t= 0; ten ist) i One -sanl(*7-d”, Ma Lid); AF printiC Enter clements we): : for Geos ixas iat) — a pintiC 7d ae ali]; os 2 = = ee ee _ : a ) E o ee faq an orray: i concept of tinea searc| a ¢ set SR aac ete ict maint > ¢ Set clieod, fo. key clermeot 5 prio fC"Lotes the vpnerty "> sean fttyd " fo) { 7 print! (‘Enter the elemeok ef the orey")* Mer (tee, fens i+) wee Lscamter yd" Senli yyy priott("Fales the element Jo be sectrchecl")” Lsconi( thd" Klecynelement; nie C$) se hey lemon" sofa iC! Elen sent fe nel} i Laectk 5 Atal: gato CE lemcot is sack found"). i} S carted (Unsorted tee Linear Search ‘ ‘ sincliucle < stelioeh» ——__ Jpted_metiac> . — ——~ Lint atsel. key, ts = i prio’ Lote 5 elemoenfs "5 — ee fer Cis0; 1<55 $44) a —_____|_scan}( "al Aalil)s Lae print tC" Ee dana ao th le pion Wa — for (iso. f = nate Tn, chdp ps fsa Gee ollcrala sir a) = printt(" olen ke emtto he serrzrhesdl): an scan $( “po” kes _ oso: tes 4) _ 4 _— itCkey= = of i1) a | 4 pstot fc Key clement “Lol founc_euf position ‘I-d" key f41) T Z ai bs exit(o) E | 2. > point Unsuccessful Search”): | > be — Binary Search Gortedl Prrrey + 2 3. 7 2 ecl_{ox colo coil tee efoto) al x20 |, 1 Lu rowosl 2 44 Ney of 109 tinclude i voicl maine? if Hot atiojlied, 4,5, bolle] 5 = ifor Gro; t2; T44) = hell AL for a — fa G=o,Js2,j ee ee Scarfe Al", Ka oo ~ ke jaar} bo BUM] = afjars + ipxin ("Tren pose fb metal \n")- foy(iz0 j22 a+) y be £ os feo fan Pruitt yd la" pesqecy): 4 Ly paste “\p") > 3 Tere tuntlton_paotatype, func” det? fant” eal — ethan — exept p2cqreim ee Date _/_/ Page Af inclucle< stdiicns h > a svoiol sumcd; > tunel” protekype void gain c > t : paint C! Enter the dow numbers"); - — Sum) = > feu cel ee ass ~ i ; faeivoid sume) ~ foot LA : : _ oT Q=16, b=20,¢) | caaths printiC’ sum = 7d", <), © Enter ‘Whe 4en0 aumbe "Sues? 30 Hinclucle Urea a void SuoapCeasnt, fot )s GB ward demenstrodte the conceph ¢{ call s vetbine ex asin poncenrelers yerlece to “the _funcl?, sinclucle _ mare sd swapCiol, tot void mete = Pea 14 _ ind_a=10, es ss SS printf C'Before_s vase ping oY prinih C= ted b= Yad)” Swoop. ee print Cn mein = 7 b= vol”, ob J; eee _ | I ~ __ void woorp C jot ow fot b) i ay a Suse = int 4 mp) — sol) ~— Jemp=as — mi Is | be10 an 7 bs temps f ~ tet “): orl WA Ep pile CGE FC na tS. bs -—,Call_by_ Reference a 7 ~~ s odd sest, + adldress. evar, oe + - Q.. | Somostrale the {_comeepl ef call by p70 FOI pa il ese eerectsOer ecmee EO — iota 10, b= 10 ~ prt £C“In_motinc>: Before callieg sianp Oar Ziel b2/cffanb); usopl £0., $b | fot terre p: demo = a; “es be *b> herny; piatf ("Ty susapty: os Zo "ben A” bb): cee I 22 oe a 7 Juro statement > > ~ 91 Demonstrate tre concept of Ay an egoumple pre ieee ov 2 aa. | Retusiy _Statersent —> hes ast te ae ___zeanclude a li _fot_sunoCtat, fot): 5 votol_mofat> = ia ~ jot M210, b= 205 C= sumCa,b); CO otet $0 Suro = nah cs [lh } L fa aeturn Ca+b); = i a | - Ainelucle : } a : ele «ek ee x os * a s dete ee A paint fC*\9"); _ ee pdt Cea jee ts td) ee a pete BAL") —~ Lx - = ~ Me — ~ rs * = x x _ ae x oa #_dnclude < stdfocb’ weick_rooint> _~ £ a Sot f — fox CG=4 =5 f4¢+) ~ brintbre aan ree jee 4 iz pant a puiolt Yoh j iL Date 44 a ea = — Page Hinchice a0) | putottt" Excellent”); else it grote BO mH ae <90). priotfC* ‘erly good De prinit C“Gond")s else if Coracle > WO 2 % dec tO) pxtoliC’ Not Bad") Module = 4 erro Pete gp rv acters, | YO Tits _a_collecton of char = [\ | cher str(ej; > max size i reste eign ee — ey P16! ead chavoctes | “a tuplatn te tfp_t nae sn shi, : a a 7 Reading Tap Nes D_sca —> scant('y.s% str); ii} _oets() —> gets C str) ith) gttchaxt) —»_Chor ch } | th_= getchaxt); | Pesplau’, | 9. aot) pate C* 5" ste Pid) dst) ne Sept satay: ti) putthox C2 — > pubchax ch); =o oo Stclto.h> = + chor ste Psoy; {scam£(" 7.8") str): elsCshc); print C23" str); oy puts Ctr); a With_using —gelchast ee | Date 4 4 __ —_ oo oo Page (etal tetas a st r ee ot — ——— oo thea th, sblz0J = a Sen pidthen 3s | : ; —mbileCehe= it) re | Se —— ae _ Rat 7 o Pe gethase oH [> OAR to fend the enefha of the Stroy ——# Lengtn—of tthe Sising : —winludesstacoks oid malo} \o st Ls] 4 : Oo | shLu] ink {20+ L sets] char str IGoJ; L stal2J printt (Enter the faxing"): L shod gets tw); M, Stylo] while Cstrff1! ="\a") . G44 5 —__| patott (+ Entered shaing Ja"): puls sta"); prints kena of ‘the striog evel" 15 3 No sh dst ae sheeted A {sh20) i = — Seog | ves (i = | = : Fes [o} = zm Oo _| svt [3d 4 g St) [oJ o oD siv2 1] Sr tfoy ADAM while loop #224 Whe le loop. See tro, {20 a ; So, j= + j= 2 pe Strifel=c reso J= Strrzred> p DI=\o s = Lane ene bay foe bhatings Hinelide Neda DS voll alin) ‘ Wl fem jen, d har ve well) ot bed, behead tnt print Rater the fort SHileg) d= scntilcetahaihsicalinatt Cs —Concaenatfey two _Stalogs Hdnclude 4 s4cho-bS_ void matecd Lf ae Aol _t=.05_) > 0+ char ses CBT; stuibsol, sivesol, — printf teoter 4 heoftrst_slaing’) 5 ets st _ printf Fs _gets( stv2)5 . while (ste t fit !='v0") cx dhe second. String*), i vesCj] = Stet [4] Ltt, jit 2 {=0+ |aohite (styoted! ='\o’) it ves [y] = stro fs]. Rte tet ty ASCLL Valice A= 65 nian! Ate Bb, 6 a eh eb > CF em a4 i include — i vesich mofin) —__—— oS Sot __ chew shise]. yeskeods oe dicey ed Het Enlra_the shing jis a ise Cantey! Ls Typ) ae aah _tCrsfi] = vu Pte seals a Ve Syed = Sttisa2 tuge _ thse > te asi} = shisl, 722: C£>=65 8ne 2uh3= ee tant e =b. (9 oP te sevens testing pinclude “ fae ‘ pee = Pointers i oe “chor ch =" wal | — 7 Sie es = ~ Date _/_2__ Page _—_ _ viel sun (mee Sot a, tol eb) fat velure Cra + [6 » wang 10 a GWAR to fiod the —sprectbest of 3 numbers —by-—pettstng —— —. | winchicle «sid, icldeceidings On i voi est Cint®, sos Zor voicl__moint 2 05 §ot_O=10, b= 2.0, c= 30 loxge, Larges = qreadese Cia, tbfeedy pia Gaenttest ouraber sit tecl tewge) 5 3 ° t ene £ itCra> sb. be ~a> *c) return *o; eke HC bo Ha seluro * b} else. sean retusa * C5 ge eee Eee ae Moclule - 5 pate = Page 7 Shuchuie i calleetion. Oo hetesegeneoues_ty peed: clevte, Acce petftex_operctor =>» dole opexcttor, (a _ 8 ae © Shullent otox! _ Mane — cha Struck 1) VSN) =. chos- 3) Ph, =? fat 4)_Bronch = chow ¢ dodot ype sword late 2s dlakotype. yox2{sizel>; Poe 2) _Grode — char : Ae latch shunfenk £ ee oe char _usmlsoL; wre : : a phone field acd a we oh Bat) renee : ee wh fe CSludent’s Informatio? L aps") 512000 riot Come =? Sy ae Pitot Bsn) 278" 58 095- : os {prt Phones 7d. Stephone)3— po, iets eee eee 1. ke e St, hang E Shuolares. fee faa cs Shauct Student & £ & Sat phone; void_mme&nc ) £ Date ye priot EC Sudent!s Toforrnation") (ee i (f20,fe655i+t) —T _—t ae ~ ~___lpintéCtNome=/5", scit-name), “print COSI = 7 +S", 8tiJ-uso); a ¥ __ iptot{ ("Phones t-cl', Sid. phone); Z _—_ —ey E uw i) Ly Astdtochs oe L oil Roakot) yu £ 5 ease fel pei, ge 2 rea 524 t= St t pirlod = Bo: Bove pf err leet ' Joro | pRrsy ——__|ptrl1] = : for piole] = sry, —\ ar fa4 paLal= as ‘ [arp _lptted pilus a3 fore s 1+ {print Ant". * ph); a pxinte(* 6 \n yd" * ptr[ul), Aneel 2 lq 2 ager o e = Bo ao ee a wats noid enaine) : iS £ . 3 im Joorols) w Sot_ovrtL 1 = £1, 2, 24S veh 9. feweted 4 worl fear 2d [o.oo] axr[2) : Eieth ———— oo pe al or 1 farrtes he 2D Princbusde esttin she ~Motd meine) afr fol aavd LI = £10,726, 20; Fol ore 2LI = 4 U0, $0, 60-70, BOF; — Fot_car|al Jos & 40,100). *pagalay= Corrl.arys2. area); | tet § ——HorCizofeas sand 0a EC ol * paaacey ys —_4 2 . = oP oarot.) 10 ook! Go. 7265 Uo 00 $0 oxrary ao o 3000 Yo. — soot] Bo ovr te] o>] 20 cars fi] . yoo 7 E | 3000, |. parte] 32000 port] A200 Pore Loy FY tag» late apis eee ETE a pista at; fon Ci=95 1283 space lilies _| _prialfC Nord. Rx pts lid);

You might also like