You are on page 1of 7
) Varendra eotace University Dept. of Computer Science & Engineering _ Assignment CSE-133 (Object Oriented Programming) | Submitted By : | Submitted To : | Mahmudul Hasan | A.S.M Delwar Hossain ID : 192311047 | Lecturer, 3rd Semester | Department Of CSE, | Section - A | Varendra University . | | Department Of CSE, | Varendra University . Submitted Date : 05-06-2020 7) Bvestion-4 How can you vndeastond the operator is HNoey" OM "Bimoney" 2 Anewent: (renevally openalon is osymbbol on special euoraealer tolueh is used fo pevfoom a speeihe task. the openatrmr Which Openale on single &penomd 4rose ome Unany operators, Some of vnomy operators one * | Cnewement Opewaten) aS (peenement Openater) & (Madness Of Opewator) . (unary minvs Operators) ~ Cown Complement) \ (Logieal wot) “These operators lich operate on Awo Speronds known aS Rinomy Operators , gomeot—tne ond we dan undtwsiand when id takes too Operands. ey 4ome et the vmony operators ome! + Binary Plus Operaten - Binowy Minus Operaton == Equal te epepatsr 2 Les tren operator. © Mestin-2 Write a C++ Rrogwom having a elss named a Amace avenloaded. fonelions yomed show. wtb inl cy, show result (mia, int b spesult tint af) In those overloaded Result om pesult (mt a, doevle ¢) ond Show fnelions ast fonetion aalavlotes “he ovenage et Jince numbers ond 2nd tnehsn finds the prodvet of times numbers ond Snd Ametion find the summation of ne omray elemeyils ond Finally display tne ovtoet, Answen, I dpinelvde Ciostream), sing momespace std dlass Resoll{ Povtie Utid show mesoll Cnt a, imdb, ind )4 dovble avewoge =lat vte)]3, _ Ze“ Average "Cdavewage seendl, void how nesull int a, mtb, doovle Mf dovvie pwoduet = at bees Gost co Pnodvad + LeProoduct ceend 25 = 2 Void Show.nesult (nt oD) ‘wt nesult = 04 wet 1s for (iso 51235 wand eswlt = pesvld+ OL 5 t Govt Le'summahion:"2c ness} Le endl : c ant main) 2 Resvld wesold : wesult, show_nesvlt (40,20,30) 5 nesult, Show. wesvlt (40,20, 30.5) 5 im ome aN a0,.20,30h5 pesult Shore vesult(ann) 5 Return 07% 3 Outpet :~ Average: 20 Produet | 6100 Suvmmahven', 60 ® Bveston BI While a e+ Progpam +o ada ed es gomplex NoMvET vsing operator overloading . a ty a. Gi ‘ eee gimelude Ctostreon using namespace Std 5 aiass add— ComplexA ‘mt a, 5 Povlie: add-tomplex(int 15 iwt jh aels p= Bo % void show_add 4 oot ceacdri"Zevs s add.domplex operaton +(add_eomplex AX add—tomplex ‘ternp 5 NOME. = oreo) At ALO 5 temp. b = ot ALLS petopn Hemp) 5 Yet anain 0) 4 ovtpet | a addcomplex Aal 0,20)1 Ar(g,40) > As 4 eovtec First Compler pe 64. Show) 5 anol LE"Seeend\n Setond Complex t"s Ay. new) > Az= Ar +A Govt GEN\H um of Complent" Ay. 500) 5 metven 05 “Elnsl Complex. 46+ 120 Seannd Complen, H+ io Sum ot eomplens 29+ 130

You might also like