Download as pdf
Download as pdf
You are on page 1of 12
KUET SESSIONAL REPORT YO Khulna University Of Engineering & Technology Course No.__€s€- \tO2___ Department Of Cooper Science and Engineering Experiment No.3 — Name of the Experiment, 1c ho Statement and “Ty nvenmon Remarks Name__Abia Horan flako g oll No__220 Date of Performance ... \&>.1z.23. RollNo__2209053 Group No._A=2. Date of Submission, - Year 1st Semester_Lst___ Page No, OL Department of Computer Science & Engineering tx5.x02 = Title: Susiteh case, qoto statement ond ype Conversion Obsectives: 2 TD Understand the we dF susdch eave stotemerb iw © programming * To comprehend the gpte stalemert ard its implications * To explone type conversion in © progemring * TR demorohncte type casting with exangles in © pmancmming Trtaoduetion + Behe: We wich pieleret ce tle ieceten veating conshanct Th evaluates on expression and dinect, progrom Flow te different code Locks baoed on the velve Syrter of susteh. cme: Te suatch stebemedk is chauchred os follows Page No._O2 Department of Computer Science & Engineering expo 0x Suiteh Cexpnession) £ care comtont4 I] Code block for content 1 break; core combat 2 1 Code block fon conmtart2 break 5 default HW Code block for core not watched Rules of — susteh... core © The exprerion wed in suriteh must be integer or enumerated type + Mumber of care statererts con vary © Th a core stetewet is true, all folloung carer will be eveerhnf if fave core stotement har nity block Tf a twe guitch statement will terminate 7 ‘| Department of Computer Science & Engineering Suriteh statemed flowehet ss are — aT mae} | t+ ~~ | ste weet |-—$+ Tithe} Page No. 02 ___ Expt No—03 1D, 4 Page No.__O4 partment of Computer Science & Engineering exj.oox Usiney range im susteh core : int num = 53) suiteh (num) € core 0 2 pret (xd is a one digit number. nur); boneak ; core 10... 99: prirdf ("ed is a two digit number’, nan) ; breok ; default pact Cad Erter a number lem then 100”): PagsNo eo saalie y | Department of Computer Science & Engineering Expt No.—0.3___ a: gpte stotement “The plo statement trom fer Ths statement 5 used + allows us te eontnal +o co labeled stetemed— baanek orconditionally Fromore, port of the Program to omother. Th cor be wed to Gump fomword dr backend go lobed | Forwed Stolen Bachword ie Joep ore ed are label; Example firdude< stdioh> wh wer) { whis ls A if Cic=toy { pact (%d",i); pe aetuand 06 Page No, 06 Department of Computer Science & Engineerittg expo 22 shodd be awsided: goto statement is ciseonaged dua te kes blll, (anderen Gil, Wis‘ sletemach oon dlaad to Spaighelh soe feadatine| make delugging chellenging. “Tape Convewion Type conversions in @ we erectal for woking with mized dede types Th expremions Type convewien can be done in two wayo CG) Automate / Implicit type conversim on “Vype promotion . wy Exe ctype conversion un Cortina a velue /-+ype casting ' 5 Page No,—22_—__ es ney ( Automoke ype convemion: © perforin aucbpatie type conversion == to prevert date loss TH operands ace ot differeck types, the lower tyre is outorobeaktey corvanted to higher type Conversion Kerenely: Long double double foot \unrigned bang in Weerond long int vrmigned ine torvention ink 1 chen! shont— Gramplas tea, dowble b= 0-57 paHh(" 2th, axy)s i] os os [Department of Computer Science & Engineering ens Expt No—23 —__—— “Tyee eat A Vorable con be mamvelly converted + arvlher data type theongt the type enrting proces Crane int num 5 (Flock) num = 123.9567 Deven pion S iting a prognom thal cartetnaver Quer: You one terked with weinre rognoy a nue nade into oa com nding) otter gn sed on H numeric gnade i 12> ponding U grode .b: Le following secle A: 90-100 G: P-29 2 70-99 0: G0-69 F. Below 6o a inpet From the w Your program shold fable a numove qrode oo inp aa ircre Lek slelemert= to determine he connepording lebiee ord woe @ switch steer a grede. Yow shodd we o ple stodement- to provide we Yk lke option to re-enter He qrede if db iy wh witlan the velid range bs a Page No.__02 ——— esr of Computer Science & Engineering tx.so 02 —— H include y t yrain () prictt (" Enter seore: "); seond ("nF *, Badi if Ca==100) printf CAD; 3 else F(a» 100) {goto As} else if Co<0) { goto Ar} abe f suuteh Ccintdalio) € coe 2 paintt (OA) 3 breok3 cove & pant ("9") break} Page No, 10 Department of Computer Science & Engineering rx.so 28 —— coe 6 printf CD) ° pantf CRY; default gets AG D. Diseumion cf The knowledge of suiteh ae statement a gpte Ss tecteme te Wed to role efficient codes, In the code stated con be efficient method wos wed to make decision the process if necessory do inte by ype Page No.l! —— Department of Computer Science & Engineering exy.so—23—— \ Tre syptas, rules. ard proetical ver of suite stedemert- lab. “The we of gob +» emily wes covered in the lace to olher wer implemented and it Sump from one fp Liss stetemerk shold be voed wes diseussed why sperorgly. ~ The proce of type Both imp ond expert tye conversisn wos else conversions Were ca. explored. Undewterding, ther ee ol A SPReiente deci molirg ord dada menipulaton in © cordituling ty th development of robust and progrers, famoble code: yon Pelienee: 5 Suslel ences) "Sustch Core, golo stelemert ond Type Conenion" sesvional by Md. Repon Tlam sin ond Safin Abmad sie. 1) geet fon gecla. ong ii) bulonich park. com Be

You might also like