0% found this document useful (0 votes)
61 views47 pages

Lab Report 3-4

Uploaded by

NIKESH RANABHAT
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)
61 views47 pages

Lab Report 3-4

Uploaded by

NIKESH RANABHAT
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/ 47
TRIBHUWAN UNIVERSITY INSTITUTE OF ENGINEERING - -PULCHOWHK CAMPUS ~~ ALAB REPORT ON EXPERIMENTS DATE: SUBMISSION DATE: SUBMI ED BY: fae SUBMITTED TO: Name: Nikesh ‘Ranabhea Department of g Electrons and Gmmunicattorr Enginecrine 4 ! [5 nn TTT aad a is Aesignet and clevelepe by Beil Laborwties of USA — © a Preqramming lanquaye ' langue, at the in 2921 by So Pat Aplevecl other ure —famitr lansueges at th Preois Ritchie - 5 yas clesuned as a syslem programm Meventies (i PLIT, ALGol ef Anitially sit was lesigned ee) : ee " language uncer UNIX it erparded to rave wide wsege or differcat sy “heacter Outpul \Laput *) Ghoructe, Taput >) Chanter Output Jo output a single. character We se the pubshar ) function ¢ reed a single character as input we use the gether ©) g 5 Shing 05 Lopetl avepve Penetivas Gt O) and puts () ae used for inputtiog and outguttmr oe jaet ers S)gets() chiagt m the output t the user o€ the cipsote Some of the formatted corsle input lovepee fh peas) Tpis function is used t read er mere inputs es ene or mustiple UnetIOAS ce one = muttile: puts fom the urer at the cearele = brunt fi) CPS fear 1 Used he isp uh a NSele{_ ene or mmurtigle Values in dhe ee roe’ Water eee ene nape HTT outay t basecl on cutout t standard ee ; ch ot is used for —formetted eT 4 ee f ah ae Fein string, ol with the lata + speuifcetion The Tne pome froneeft) fare eutput are “the parameters © Sy tax: pant f (form gta. 1, hota 2) Saetex pact (format, deta 1, hention string TIns 340g cookers, an thi s je —fermat spec J) Syotex format is th Z a ae beginning with the symbol 1 for euch vawable f= be output Joliewed by a cheracter cated the converters character Exampie Pet Oh” wen) Peneeteay a za ve { provides This fometton seanf() is used for formetted mpue Jom standard put acd pr 7 7, } d the furctan ponefi/ Syotm, Sevnf meng of the eopvesion -Jeutiies (Forse, our (ave 2-2) The—functesn. Seafiae) rend ens eae tesicha ree Deaf oceamtce scarce th 0" meme, g clepending on the format specrfreation sting and stores “the input in locations represented by the other etsguments Cour 1, riaar? ) Ex sunt (fe, fd, Nome, £ Rete); eae Syatan je syntax of the if statement in © propramanng is f Cecnditens) “ Stucemerte mside body. of # y else 9 [ Stucements side body of ele Ml Stoe by fF & \ ane af Statement york) 2) Phe i stetement fe) ltf the t T f ace executed. eypresiiot ts evaluated t» false, the statements inside the ae 7 caf the test of ae oe ee statements Gf ef fo che Aad of statement can be fortoued by om options! else Hf --. alse stutenrcr€ which inven usefut to tere Various conditivas using single f-- else off Sbatemeck fy ie of of cnn have porn te many else of 5 andl they rust came before ofr Gian ete) . One 22 ele tested evaluates the test expression inside the stwtements yrside the back He expression 3 evalueted fo true solubirs, executed. be remembered. elses ard (t must camebuck after any els ce Succeeds ese of the ges ele of 5 or elie“ will be thm 2) Step: start Steps = Read a characte Step TH + Read a charecter Step B Display the characte Step V+ End 2) Stept > Start SGT Dela re ee Step UL : Reed string J character 193-4976 6 feael a a nn freig Sf, aS Hf 028 te, 54.0 1f Step VY ~ Step Stark . Dectore cherortey ch- a step IL i step OT + Read charac tay ST Display cherecttr iG, a0¢,- 206 Ste Step eee eee a | Stepil : start Pe Step Tl . Declare seeng. = aT lwe khara Step IL : Read cone O Seay OUpItimpans 5) Es, Gs) AS 82) 15 I2) IY Step + Step 8) Sipe es exc StepIl + Pectare mteger az 123US float fe aza9si6) hac cha eS A (me Going a Step UT + Reod n,m, ch, s€c Steg W + Display a upto 7 Lecmal places m upte 22 decimal places and 5 Leama’ (ons ch by leony 2 pecs ahead str upte 26 characterS Stop D+ Stop 3) step -Stet StepIt - Dectare méges a and b. Step Hi = Read ‘integers 2 and Step Dispieg UE react and stored value of a Xb is: Step V * Ste he Step LE + Stat step I+ Declare string 56 Step Ei = Read and store string ug To characters Step LZ ~ Display stom step @ « Ste 42) sterL » Sturt step HE 1 Dectere: tong? Ser Fee I + Display 2294S | fleet Pees | Charecter ch: (a! | Str ste =" | < Begs il ae == ——__»—_, amch / 7 cleemal places and 5 decrnal pent] play up f m upte 12 places / ney ced / ch ashy Teviy. 4 emaly Spe! y soe ED 3) ee integers a, b| (a integers a Dispel the read and steer values of a and ae Ee 6 ij A ag aie nee re fa-3 a ay ve EES], ed a1) Gtarb) y Delors sng. str | oO {Display enter the strmgd Fee aaa oe Read and store soya sterad sang OO _ — << 2 ae SHE include Astle hD HE include ore h> mt k Cint)) Veil man C ) Meaney printf ("Enter number a; \n")) Scanf & td", fol; $= k ¢alj - pemef ( he gum unte fel catucal numbers is Fd, Was) ger); he kGnt a) if @==3) Yetum 2 7 else retum Latk(n-1))j 7 Output _ eae F The sum upto FE natural aumbers is 25 *) WAP te nerat® Fiboracei Serves * tenure adden Seurce code He inctude Lsidieh> SE Wola eae AS oat Jibe Cint i); int man C) 5 he ihe ' pa " Spter qumbw upto which you west Secs ) Grey ey or (€ =0,c 1; €+F#) eGfenceay pratt Cobel Ve) fh; 1% - ch); int five Cnt 4} x if ee) retumr O, 7 ae ee) return 47 Ise ae (feo) fej ? Output ; (pte number up whith Yeu Wank sere a ee | a quen number, J Lema. oO loo which excothy nd Sum fon Eig bi aneepk © ie 4 c me aac f Za ee ae Ds Tiatter Gene fem ca and ne eure el Meae(e HE inelude Cstebtoh > tt Melude me Peck Cit); mE man & we Sym = 0, ay Se (Gree = toe) C44) & a= chek Ci) 5 Sum = sum +a jemefeTh san is fd | Saad) returr oO; mt check Cmte al< mt b=o; of (a5 ok return aj x else € GEE retun b; The sum is P50 eg Elly with fe rela type and fo ep arn ae 6) Faaction Dee Zstdioh> vaid sum C )/ mt marcy or Cy a sum C) Suz Sure =e) jer CME LH 2 FE Too rae of Cifs==0 8k ify! =o)8 cum +1 sum = y S fof Th si peecer far td, sum); a The sum is Be. Ig oan wth cetun type CE aegument Source ode HE include 2 stcho-h> Me sam) WE men jo 10 a - Sun C): pref Othe sine ts PAN retum 0; int sum) S po wt f= tpi C400; tt) nye if Chs = 20 Bh itu = of Ale sua FEB Sum = surti y 5 (etum sum; d) Function with argument but 2 retum type Source code dt Include. Lstdioh> ie Gre) int man © x ME 2= sex Sum Ca); Cee cag re | ME sum =o} | for Cit t= 36 Emo, FANE | if Cit =-084) Fl =o Sum = Sumic) EE iar ee ee Output art um itd" sum); f Zp BG Giewar js Ds, y area a a a ) Ath metude Zstdioh> SH jnctude Geonte > ott include Cstellb A> ne man) char a getch a getehat/ Systea Chels 5 pints (" Znter nether a gctcher e gether (Dj prntf ("Enter any characters ")) a getch = getch(); pune f (Vn Value taken WE fe Putchar (a grtchar]) panef ("No Vatue taken via getch sy putchar @ ~geth) j < gee Oi peturn 0} a Output he F fater andher character * choacter:")i tehac ts ij Enter ang character Vataes Cee ieee ae poate | Value ther via geech Is | 2) melude estedio hr HE tnelude < conte hb? | HA dude © Stdlilbh > | | | nt man) 4 int character, sb C25) | suseermn (Mele) | pant CEnter the chareeter:")j Seanf ("fc & character); | pane (Seer the strny with ae spaces s"); | eee eee z Cla pref \ c ee character ou faponen tee D Breen); | Hf (Mn The string You a iy | en : str ou Rave enter tr f5') stony J get Cpe Cutput | ee &) Eater Dh Cpaereen A | 2 Eater the ster with Mo Spaces Patechowk. The character So fare enteral) Ist The striy you fave enterals flulchook A mi Melude LZ stelle > Melude Zeonieh > Pie oats stdib-h> int man ¢ ) x char sting, gots £95; system CZig"), prof fier Lene 8-2 Cae feed ji ah ; : east (a The stony oy oe have entered is "yy Pees Serig ots); 6 Stay, Feturn 0; Ovypue on ae a oe “ihe sting ee Jive entered 15 Balchousk Y. Hh melude ctelioh> +4 welude Leotioh> Ht include C stdiib h> ae man () ME a= 229U55 system ("els"); pintf Cn Case a Fd ali poe \a Cased? 64, 4); pont ("In ease 3: f 35d" 1 ads pe yf "In Case 4: f- 15d") aly "Va Caw 5+ feISA' a); (CN Ge BF 12557 a), mt ts mef (" ln Gie®: Padi); eek C) ela 4 Ougre Case 223uS coe d 12345 case 3 azsus Pe eae cone § - .0000COPO 0323S Cee cose E> 293U5 De ie eee h> eee) We a, bj System ("els |; port (" Speer the number We Sarf (" ie bo); ji frmt The reed and stored value f ais fdlala, a} ponif C° ter eveher matey amber"); seof (' f3d", Lb); ; ee oy oh ee f b is fd\n' by Output Enter the Aumber 117 FUSEFEI (The read ard stored value of ais 225use?ES Git excther — wrteser value + FID UER (The read and sterol value of b ip 323 de) te include Cstdioh>d Ab include Geen hd pnt man C) 32 str (5°); waysten (cls); ie ptf ate the sey" I “seonf(C tec’, 3 str por C Reed story fs te) ger’ dy 7 Outpul es the eae Wer eaygyexsnee “fo Read stons eae Suerval EE Tat intude 2etele b> HE include £ conto H> mt main( ) char str [Jo } = "TL love Plchova 5 System (Ciclo) printf (" In Grea: fs; st)j eo In Gse2: ads" str), printf ("\a Cased » f- 365" str) port{C' \n Ge 4: 7-16 85", ste), pontt C ln Gse 5 * f -18:95'; ote ys pone (* \n (ase 6: f- 55%, str} pone (ln Gs 2:7 305% str) Geko; 3 Cae 1 +L hve amcor (Ge) aD love fobhere. Case 3° love fobhoe. Case 4: tT lve B Gxe Se eve Me Cree igre Laglury | see SE ler Beasley: BH melude Cstdioh> it rare ©) ie | wt n= Let m Chor ho =O; , |) fares og ear Galehrone; een am — 112. 5f VR 2elastr ~ f16s\0,m, cst); printf Ca = fAd\ y 4234S; 123-9876} Outyvt fra 1235 ee che 4 ye ee Marc Laslony HE include < ctdio-hd Mt mon( ) ; a chor ste C90; Syetem Cel"); pref ("Enter -the sing Ty Sean] I Ga-30-9)), str) printf ("Read sting f-s', str) Outgut Enter the stony. nawjegt Read sting roiied Reod the rtrmy ak hea onwek UW) F kAr Rood string: ak ad st melude Cstdiohd mt = man) chor st CA0J; System (Nelstf pert" Giter the string"); (searf 1 {MD st; pref (bead streg oops seh 7 ut LEE eso Poteet acrovion guj 5495149 ea } 309 | ake 5 ‘ha tang ACT qeroviner 245) (su 9ST ES lei Si Qe BF atch Lah 4 cis its control structure anef one fi te J Pe ete FEI Wire og Oi eri ne Le central x of feituing Rn. Desig components Method te achiewe 4. ce ef AX aecurote emer resistance Structure. i) eee iwentia seracture (straight Ine fos 1 executing one rection after erether ) Mh ore instruction after UW) Seleccwe Strueture Chrarching) : execvtwe chffernt secttons clepending on the cen bien er Value Af variable. (ii) Repetitwe strecture (hap | [beretton] executing mame sectins of code fore than once. erry ey Aina A nla : = ie Gest EG 1 ie o Fhetioa 2] a |[Aaza_3 | pa Eee >| a Exit Exe eo v p= ection a Serecave fs: Basie Contre! Stractards tot, ie oe aie Heck ae ae J Fate ee | Streemene( Jl ae eer, eat eee y Exe fig General fom 3 fio chart of tf an ea) cle of (contitna- 3) Statement ~ 3; — > else if cance t 3) Stetemmet - nj as else defout cae statemet nL alts a cas is jacller White foe A while lop mm < repeatedly epecuts a tuget ‘statement a5 lors es ver condition is true tag «white ( condition) 3 eran statemieas The & redition VYalue The log mberates a eet ea aa aan nay be of am expression 1 are white the condition (5 trae fon Zen tre i's any Je- while Leop Jaliee fer ancl while less whic test the lop oe co Ufaile loop Im = Prgrancng Checles lop, excegt the fact thet it 15 gunranted fo execute ime Serta « clo Piimece che top of the fe condition ot the beter at least one Statements 65) ; J white Ceencibon) Hf the condition is run the fixe of exte-l formes emement= co acc °< detement 63) wn the (oop erecutes agan Thy precess repeats url ga ca scent eee or Log A fer (og a repetition copteels structure thet ileus you t= of ficeoey vite a lop thet feeds create 4 speedfic pumber of times, ‘ Syotap fer Gir enter) < ; 4 Statements wmside the bole of the (oop fu (asp Wek as The wnitiangotion statement eten s ment (5 executed ony once » Then, the test exgressnr is evaluated Ef the ese erprestion j fr oy Bee, Fes However, pf the test d rptsier jy evaluated to t Coa yi ae e e rue , statements ‘ a Se ye eed oad the update expression (5 upeoted, ee » Agar, the tes expression Is evaluccect Le ene ata se Start Ue Qectare n and at if AMD equals © b Pime puaber i odd uf H 4 10 22 qquol 0 Pirme 15 divesibie by 42 if a mo? ~ equals © Pernt © Avisibve by 2 Pent number is ever ac ue 5 FINE LIS greater d then 106 Fé 5 atthe olwitite 4y 4a ter bq. lve Steg. :) te Stake nr Becare a, he and Teaday Value ee user uh if IV Catcatetng v. tf ds=o fore Catewtete the oye rue oot andl print them a rt equals tO dl (discamnnant) vir Stee Cateutote the Seal root and prot then ee 4) Stat Ile Doclace ab and opewer ard Read its value ees een eze Pine oth Pint a-b Ofsut Prents ath Sequals oO True Gf fuss Prin ES Prost You did tet mes o enter eight eperetrr oo We Ste Cob Stack Ne Declare and read value ofa Wi. Swit (a) Prime Sunde a — Sa go Part Tuesda Pont Thursdoy. Peete bucty AB Pare Wedersday Pant Fades. wr See EI Stare i yeed th Deter tambien: laine uy Uf x20 eietees rzoard Caleulele fo)- = (0-2) Om 25) fotze ad eae Ard Pemt 145 Value fale ) pont Varuc f FO Casuisee FO) = -25) 0-2) xn Dao ard Co-ae) and pone its Jalae aaiete es (-25) 9-28) C-3e) and pane it Value Catturate fo) = C7 -leoJ Cr-2e) Be) ard pack #5 Value Pee a>4ts awd ee mprLo and mo =30 Pane © vy Seep pan to) Algontho Start dr. Aectace sum=o put vad entmes =o, enttS=0 overage = 0 TL. While 2 i Readhry trpué ay faee v lagué < ons gua nef true valid erbus=0 Pent you dd input any Vaid Aunbes Pome total entnes volid entre) Cums meee in = curineaicemerenc) f m TH fave mere aod ingul €= 200 af fous if tue Mnpet med G20 fngue =0 and entries = (agut med 6 noe erties 42 equal, == Zee Tre Sum = Sum + tnput valid entries = atid Qumber +2 vi) Step po eS [Decor ard read Yana bier/, | Gap o ae an poe Boies pe 3) uy) as > Ss Y Dectare $2, $2, 59, 5p, area] Gee Sa SEs +5) Stab Decare variable 2D read its ae alphabet Start pen ; Oe / aa a fit ent ee) [Pome 3 _ fit en Lea ce) oe peater tha) “ pe? Bie [AA is neither Svisibie ae Ad ror We = é) Cie ee fase ——— a 7 | ae es ara ee le Cateutaee the Seal rect / pont them and pane thee / | a ——— — ty Declare vaviahle ad reac 143 valise SEPA, dad fant value <, fod i ee eer Wh a Bice and > | [Fetes =xlr-30)¢r-25) [Ome tis Vatue [eee ay | FO) = 015) ee) 10, Eensilptata eee Cateuate Pr) = (2-35) 219) 2-34) ood [ape uc scone) Calculate | fren =r -4e) ty) Cu Be) ane Glart) Declare anc read) L valise of 7 | a» = Poe ——_.—___Switeh (a) > _ | | fp, a ey L tl ab Eiat SUNDAY) Print monoAy Pant Tacsday] Pose wedi) Fase’ Bint Ths vsdey) Prat Fd ay | | | | | eels | | | | | 1G! ae EA) Start) ectare a,b and operator sed Readies vatee [Pert a1) front a-b] ie fants ak Hate | ey) fey | | [ea | Gtat J - V Detlare Fart =O, puts valid entries =2, e018 =9 areryece iy im SE ——~ithile > yp wt E Sa ya aa Ss A = prfput eq ust TauecOalld entep— Tee Mant you did t Ne ee a [/ ingud ony, vai Seale, ee 4 po | ; eae) False 7 00% fe aS = eee / valid one 3 f Eee | [sum head ents] | Fee and > Heo pAput me dg Somes | eee | [Sun Ssum ¢inpue valid ents = valid pate +4) input = © centres = ertres + FEE EEE 1) SHE nelude Lethe h > He include Zstdhb-h> Ht elude Ceorie NP WE man OF inte age; sustem ("els ij part" (ater ger ¥ yh Cae age) ; peclf Cn Your age is td? 45s) Hf (eye > = 65) ift “Va Your can grt security allenance-"Ji part ase ' prntf ( yen epee ot yy getch C My oo 5 Output (ter pur age +65 Your ayes eSs You con get Saunity allowance: Enter Jour aye 13S Year aye 29 You exe © ge security alleworee a ——— AJ EE Melude ¢ stelieh> SH wnictude Leone h> ME man(7X nk quer} Sytem: ("9h ; prot] (Sater any Aurber " sean f Cd" 2 number) printf ("\n Number = [-d', number); if (number == o)L pontf ("ln te ih pero yy ue Casmber Do l¥& prt “Va Number 15 pevtve:)) else eel ln lumber ix payetve)j gar Oy 1 Outpul Znter any. number = 9 Number = § Number is posite frter ang aumbers 6 Number 2 -& Number bs Megotive: priter any numba <0 Number =0 ie 9 Pere —— >=: — — — — — —— EE Doe include Z stdionh? HH melude stl h> AH thetude Leonie h> H melude Crrath > rt mam C)£ x loxt-.cicle-cne, site be2, System Cele") pret Side ane" fj Seanf (“tf Sside-on payee we tue"); Z C ap LL side tos} punt ("Sde three") eae if |S side thee} Semi penmeter= i ie iter # (semi -peaimeter «Si Area = Semipecm “site oe (Semi - perineter— side-thee)) le Eheee, cemr.perumetel, area - Square area; i do. tue f side thee) (2 ey Ce nee eer pte area. = pow (area -quare, 0°S)j oe = eye sd= if (Stile bie Eafe Eire) ise Oe bd& Gile ove + side pee) aside EO ime One arco Oe ree TE area); a else | a (after: Side giver were act of iene. Check gear vale ere etch petun 2; Outpt Gide e723 Sicle two + 4 ba ee he aves f the -trhengle is 6c. Side one 18 Site CP = 5 Side ree 210 Erree Side gwen were not oF treangle heck eur value once = “i ) HB indude 2stdioh> =tt inelude Ceonioh> Hf metude Cstdlbh> int man CJL char character j System. Crets"); a Pom (" Enter aa cdphabet™ Ji Seoart ("4 ", deharecter)} oon (Alphabet fe’, character) ce chanster > a5DEL cfarect 2-122) ll Gcharoetere SES) L& character 2= 5e))< IF Coheriter > 265 Lb character € 30) pemof ("late is Upfet case”); else kL pref (Init tr Inwer Cate »y ) a prirtf(\n CRteR You cide snprl alphabe€ "Jj 2 peturn 0) y Qutpet motes an alphobee + R iter aa alphabet A Alphabet & Alphabee & i & OUR OSE (Ee bs upper CASE. Enter 2 alphabet =a | Alphabee a fe | is) Vetere ecore \ppter 20 alphobet L Aiprabee: & RRR You dnt Input alphobee- SD) SE metude Zstelieh) =t Melude Ca vo A> | it man C) wiurigned ant aunberj pan tf (" Garter any numbers! ]) seanf (fu £ aumber)) promi Ca Nuaber = fu, Were) if Comber f 2 = =o) ponte’ le nlunbe py even number if (number > Lee) NI fom 5) else yy of C In Number iy grenter Bore ize.) ae C Na Number jx odd number") af “( pummber FAL = a pow is if ounber pee = 5 {wef (' im Number a» dose a) D) ef-( ln Nanter ip dive by 2 else > poe ('N lumber isnt daible Py fee) Gere yp J ule utp Erter any numbers 1 A ber > a ee EG Nuc bee ome ee waded ruater ‘Number U old od amber limber aN ‘Nuunber i vate by @ [lumber ts pte fuble by dae t- pater ay numbel a iter any number: 497 is odd umber Numbers 192 Mar ber pucbe i diseibie by 2a Number ix even Number Number is geoter than 1e0 © Hh metude Zstdioh> =H include cca p> | tH include C moth HD | mt man C) y five ai bic, decmeart tentecnecr ml ieee Taal) ne Tene pure (" Enter the vac of abe \a sean f AF AF AF | La, Sb Le); a fuse) Ls diseeanmant = pow(b 2) -U ta #7 a Chirenmmert = =2) (ote =e OI foe Cl rae S))/ Kah root too reall biepon Cheearanese 0 3) CLAS) Pent (Vn Rmt oe ff | beck? fof, tobeane cal, coca hraninare ac) oe rook tus -ceal dtccaminant = — diserrmnant (eae ay rect --tew- Ceol Cb) (Ka) | rect mag nun — (gov CelirenmmartsO-5)) [CL Hah} . pine (MeRect one 12+ 4 1f\ ihae Tae : f 2fit) Poot ene - real, fest monary. (0H eS ay } 4 J | else nef \n You cdr give correct quehet© cquatt My | 5 | | | | eae) y Onpe pater the valee of abe Rost Ore 1 =2.0nt 993i 2 ht Two: ~£-004 2-F31 Ret Tuc: “4-06 5 the value of abe: Qs Hh include Estlioh> SE include Ceonte MD hae pan () loxt umber, function value; jh (3 ae (alE\EFG@)\nla)/ pref X=" seaf (If d. number); ve fee) Sei He of Casmber do BS number @ ie) 7 i fanctin value = qumber* (number - 10) ¥ Caumber 25) cise Cf (number >1044 number 225) 5 Q unetiva-—value = (rumber—to) ¥ (aumber- 15] # (aumber oto} is f ( number > a5 LL number <= 2s) x function value = (number ~30) # Cnamber-35)* Coumber- 20); 4 dee Ge (member 20 2L number <=36) Taneton vatue = (number 30) % (number -~20)% (number e) | ae le ie ae 20) enef InThe value foro lalate foorton- valud, |e Gy |) Outpst To caleutete » Fx) Je aleulote | Fa) xX -12 | i} 2 = e —functere | ae ee -the — fonction Is 2-c000 a ty se Ff ce ff s Ly Je Caleulat® Fee) KL fe vaise of the —fonctien 0 Lal lo cateutate - me @) ve peice of footer is 2-000 lo cateulete Fer) eas The value of fore is 325-000 Teo caleulete Fer) Kus Che value capathe juaceee ES +h meude =H include Zeenio h> mt man) ort clay number j pref (" Numberfom 3-2"); ER deca) pentf G Nala Corresponding Day im Weds inlalate!); switch (less - number) cued prin of (sun oAy"); jee eae WEE pwondAt”)i break j cae S pearef CTVES DAY; freale 5 core Ue re coe peonesany )i ee (Tuer); break 7 case 6 panef (" FainAy Si "break e000 ea Garena Printf-(* SG) oe lefaurt § : ’ iy wage Vel | aapoa ts (lalal€ Your lida AM ete ween: 2) breaie 4 } atch) L d Output Number fen 3-4 4 Corre spending Ory. 10 Weel SUNOAY Number from 3-22 Grcesgeading Hay Wo week, MonoAt Number fem aE Couespadina Dey in week TJuEes: on Namber fen a Corresponds Day n weonestAt Number fen Bi) Lore spendiny, Day In wee THUASOAy Number fen 43-4 °6 Cercespriley Ors; F077 Number for ran a Dew fa Week uA Qu Week In Weel = fin a as fe in Week Courespendiog Dos, 1) | ERboe! U1 You chdat ge asked qumber. |S) Hh include. Zsteloh? =H include Lenioch > mt manC ) mrt specced one, operand {ut0} char eperetorj fle: aaswerj pont f ("Operaed. ene) Seanf Cod " Leperand one); pemtf ("Operant two") feanf (tcl, 2 epeceod tye); ponef Coperstor: se g (het, Seperate )t switch (operator) 2 caren answer | Speraod wo +9 Operard “tu 3 erator. + Operator. — Value is 13.90 Value UF Sco a perand one : 5 ° é Operand tio: £ Operand one a Cyerator. ¥ operand two t s i Value & Unor Cperator Waites fee, Operand Ove + Cperard two: G Operacer- f Erev | Qere Quisea exer. Ao) =H ndude 2stdteh> “HE include Zeenio-h> He include Zstdbh> + snetude €strmy-h> int mar ) J The suman a eptres 2} of valid Mumber = ©, valid qumber E505] feat averene 20} Cher mput Cac) System CPcioyy VEST ION IoSYsTEM - -—>lalala’); pamef-("EIE ~--f anlf (HELE (om TAKING INGOT --—>)oelaln'): tne Cay nef (avatue ‘fed :",entnes ); | scot (1S mpul)i ft streme Cnput "Ne" ) = =2)WCstreme (input, ae") Il ( Stree (re (Ne: i Th fang. e o)) + (fo - of - valid - numba ~ =o) ee _ A QUESTION 10 sysTEm -- > Inlalo yy > \alata’); Xe 5 i RE ee r es i nl ~ Jsystém ANALY SU CESOLT purl, Welle é HIE ILL LL Leeeee petilata'); perc = ————————————— Cm — printf (You didnt enter the umber with the follwing characteusth > lala") pemef (IEVE-SDistbte by 9\a")i pont (1 LE ~> Net clivurbte by 61a") be between + te Joo \nia'} pone f(" WEte--> Neaber shout port ("Ja larert Lo--Treoks for wi our system —— Sey gehO), y ele System Cools} pref (\ELE 2 -- GuesTIoN 10 S¥sTEM-- sfAl)y pontf-(\ Ve Ve 2+ Sysrem ANALYSES RESOLT- Ssjatata' pemef (Total Oumber af erties ydlay entre -2); pam ef C Vad frtres: Fdlalay po of- vai pumber} pen tf ("In vated Groves "} Se Cint (20; (eno of valld Auber; it#) re peotf (CL, daid Dumber ay) 3 avereye = pref (" n loSum *fd" sun} prrt{C \VAenge = 1-2f' averane }y ei 2 TRadks for tng our ee 1e EI " i ot) sun Iooof valid Numb; tr exit Ce); 4 J else = Cetin Cngst) } caf) Se part = pe Mather Sat i else ce--'2') iF f ce cr = input umber # Jo #2; & i cee inpt number = mputnumber ¥ Lo t 3) Ase of Gaze 1) Ga Qumber = inpyt | cleus Cemee asp) < Mout Number > mput umber # 1045, member aarrd) aa 62g) input Aumbe = naput number F210 +6) 3 d else if Coz (2) — Mout number = mput Number HK acth def Ce=='9') Mput Number = Mout number FI0 4g 1 G2 Bi) we plumber = apie gumba tter27 ae of (Gey) Pe Number = move number ¥ 10 FO 5 ff peartef td", mput umber jy home number Do L& mput number Ka 209 “ (Cngut number [-5 ~ 2)EL (impute number £61 =0)) | = gut dumber tJum, | oe - valid Quabe}~ mput number; Valid aumber C fe fe-cf— valtd Aumber +47 impute Dumber =o, opt ott; 5 ae f é QUESTION 1° SYSTEM - - > ee SARIN MING == =e Value 2° US Value 2: 5D Value 3 + 25 Value 4 + 9D Vatue 5 * W562 Value 6 = Value F yt Vales f= ee value 9 * 2 Value Jo : $6 Value 12 + 99 16 Ae Value a2 Value 23 Cae PoEsT Ion) BES YUE aaa G—-sySTEM ANALYSE RESULT ~~~ Vetal number afm ectves 122 Valiel Exrtries ~Y Valid epee US 9 ee Sum +234 fwerge = 58-50 (a ALE ie ae syrteme = valid — Auenbers, fer fe on €-- -GvestieN 10° System ~--? €-= SYSTEM ANAYSS RESULT --? TIT ERaoR 111 t Vor ee Monee a ge car fetloniey charactenteut > Dyvisible by gs > Praile [ye & | 5 Number sfoath be betvee 4 t- too L- Theoks fe wang. our System -- > it —fom user lilee Palys, Mme rsemeans) co Us ty Here we fe lecmed ee eae Lab 2 prgrem At and 12) for EG! Fe of elements take (lab 3 Prgam 20) ‘and’ mony Mere In saniler ays We (ear Frew ae ema ea einai cone Ee rae, fad 2%, f m cue e, firs the umber te display after clecimal ntlectert> Jaf, Cnuth uber tfe clegley, of varebies Clab 3 Program 1 5 & 70) Wier ee (err) phe 128 of else. stertement® gf else tf laditer, for fap whie (ap. de-~ while larg works i IG ee Undecrind the workays of stotements or building — lage clectsian Eatery pregrem pore with Permatted Ingut foutput Conclusion er) roe Aaah leat 3a cin nue shell, we and — leaping Als we shape statemets became acquistance ourselves

You might also like