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

programs on simple computations

C programming

Uploaded by

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

programs on simple computations

C programming

Uploaded by

Dhamodhar Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 21
ecto A 1 To perform Acithmet(e operceti rotion Ss pin: TO write ac- Program to perform the ae operarions (sum gj , differen product, division ) ‘ , aigor'* mt ster | + Start cep 2 : ster Read a,b valuss gum, differen, product , divisyon exer 3 : print a,P volues stent gum =atb digherena = ab product = o*b aivision = alb geeeS print sum, aigference product, division step : StoP gource code * + include cStdioh 7 ype maind) at feu eG product, qivysion 9 f int yb, SU) Sa 4 yotuss" Ii scant ¢ gum, aif ferona ~ a-by product = o*b > aivisin = old) prins #C" sam = 74 argferena = 7 d products 74 ayyision = 7 at sum, aiggerene, prong division »y pemin 07 Scanned with CamScanner “star t) ro «4 4 | Read | ab valus | iB | uv Tpisplay a,b / / / voqus & | addition sorb “ ae / pisplay addittoyy guptyactvon , mursier cate) division (stoP ) Scanned with CamScanner on ected inp Ue % Enter a and b yotus B32 pureed ourpue Th sum =S The Ay Fferen@ =) Th product = ted iviston =) actual in put ener a and pb vows 3 % : oly ah sum =S TM arpferene cha product ae Tha aivision — Resurt * Scanned with CamScanner ero SwaP two numbers Aime: TO wri MEE Qc - program ta gwap HOS numbers igorithm step |: Start step 2 + Read a,b, + print a,b Vows ste? 3 greP er too a-b bat seers print VOWS of Grd alex swapiry gter 6 stor source code * + ynciaaestdio-n? int moar TAC) { int a,b, 45 " b)) era toy pap > ae 1) a, a,b)5 Joluus of a and bed, 4 : ‘ a,d)) na b after gworing rgytd requxn D) } nab 3 Qo i t ois of aid Fupectea input * eter v : as expected oureut a and. b ager Soaring s 10 actual Input? Ene yous OF O and 2 tee ackUa) out put: a and b evarad swarind ap twa number. pesyrl + pena th program to gap +wWa numbers A guccesssuiry exec kd couth attferent vals Scanned with CamScanner Flow chart —_ = Scanned with CamScanner 2 el © %- To perfor rn addit! Baia’ NEON of two numbers : To ( ae Cc Program +o perform sum of two atgoritm + step! Start step2 © Deciate a, b, sum ster 3 ° Read vaitres of a,b - gteP + Sum = arb steps : Display sum ster 6 : StoP source code: # includezstdio-h7 int maint? { ink a, b, sum) prints CY cnive vars of o and ); scant ("yd 18,88) $d); Sum = ats prints ("the sam is yd S40) | retarm D0; ' 3 | Expected input! | cave Waiuis of a.and b 2 3 Eu pec: ooreut> SerTh sum (s 5 10 ACTUAL F Beta OU PAE: IN PE: Gime yaluss Of a ant b S the sum iS IS i Q y | RRB Henk tHe program 40. ferform sum of | © pumbets hag sucessfully exucated with LZ Aitteens vais, Scanned with CamScanner FE lou> chat = [oees/ Scanned with CamScanner 2 total and average of numbes To wie a ¢- Program whien Finds total and of numbers overage pigoritnm * eer 1 2 SHOE grep 2 peciare a,b, c, tnd. grep 3 + Read yours of a,b, C- eter t te arprte eer | avg = #/3 rer & | pisprray & and ayg etek 7 : StoP Source, code? 4 incudezstdioh7 int main) ¢ prowk GPL OND) prines (gine VOUS of a,b,6 9° scant rf ye vt Ro gp, KO) te arr 5 avg = t13) : ph 1, $09) printf (" Torat and average Ts 2 return 0} pupectes. an OY: wis of adie jo 1° 10 | Bxpecka pur poral and average 1S zo 10 pckuay npr + give yous of Adio 20-29 %0 urate * TEA! ana average 1s go *° + ence et progrart xO find 4otal and ed vaith Yruryag pas been sucessta\ts en cect ditferens Vals, Scanned with CamScanner Stor peciar e _ a,b,¢,€ and og Read . a,bandc Fd ‘Scanned with CamScanner To ei [ail aim: TO write C- program which finds simple interes igor thm * steP i: Setare seer? © vecioce p,T,R EST 4 gtep3 ) Read tht vanes of P,Tand R step 4+: S2T= (PTR) Jl0o greps * visrlay ST seer 6 stor source code: He Inciudkestdiorh > int mond) {Float eT, R St) a youues of @,Tand R25 print£ "9 geantC 18 aot pf", KP ET RR) gr 2 lek TERI II00 5 \ » seant € print é (" simp spice ts 7-4, ST) getumn Of : 3 expected pareur? give yoluLs of wie. © e 10 expeced/oureur * sire & narest VS 10 er, and g 2 2026 input : aive voruss of purPdd? giynpa in wese (S $° fogrart 0 find Free ACA WAAL Regutt: yen +2 execu ed FY differens vars sim PLL INK eS es Sumssfurg Scanned with CamScanner ww a Declare P,T, and ST [fcaa 6.8] [er= re] Scanned with CamScanner a 6. To find area of civcle aim? ro wnte a c-progr - ame to find . circ - the aren of aigon thm : seep 1 Start seer 2 Petlare and @ steed ¢ Read (ae )* Or shee + a grep s : PisPlay & eter & SxoP Source code + ge inciuck 26tdio 7 § Float o> pants" give voit of 0" )5 scare (“- “Rr)y ae gaat print C qu asea is VF, a); gerarn 0} 3 expected input Lee vous of 6 i tp afta tS it 10 Brpected 08F we vous of 0 400 pur: 9 roe Sle ure at The axes progam 40 find aro of eesurt: wence tH succes SFUNY enccud FOY ciccls Was difcexent Vales Scanned with CamScanner _eiow taste (®) ‘Scanned with CamScanner | ee to ! are 7 e Oo of triangle fim: To write ¢-program which Finds Oe ne pigorish™: Je, steel: Start gkeP2 + eclore h,b, & seep 3: Read b/h geet as (os) bh kee piselay & gree b ¢ stoP source code: “inciudacststo b? int main? { ftoox bP) printt cgi yas of band no cont (ee pe" Sv, Fn); as (o5)*b*h) ering Cok: area te TF, 9 resin 0} 3 expecked INPUT gine vous of pana h tO FP expected ouput area is 50 7 i Us of and h vO 20 paul ines give VAs bd Acesal © pur > TH oven 5 qoo peguk : ene 4h proysam 4o find area of excacuttd for Axi org has guces s funy yen ows Scanned with CamScanner and ‘Scanned with CamScanner eee en g. prea of Tecteange ecform perform a c-program to cayeuete th exrcurcnte. the pim: Te axed of Tectangl aigornenen * glee) ° Start crepe © Seciare $,b, ea cter3 * Read 4> ter : asea = HP eter 5 s prysplay aree ete eb SHOP source code? gpinciade 25ts'0 h> nt main) { flow 4, d, AFCO } prinee Center Ugh cna breadth!) wyg TE, RAPED seat ( aren = dtd; esinst ("1 £ i", areas return 0) 3 expected Inport: enter length ana preadth 2 sypecte$ utr at! oxea = 3 pcbual inet Eniey gan and brecidth of Gee OF 4: | (ae recten gk s pena tk program of ofea of SOU ~ CCRSSFUNY enrecuit d worth arefesem yates Ee Scanned with CamScanner Flow chart [865 aves) Scanned with CamScanner Bq, consi godt to fahrenbelt conversion pin: To perform O Cc-program +0 convert the temp re TOIT, from centtgrade 40 fahren. pigonith™ * gteP 1 + Start excep 2 ¢ peciare GF eters ° Reade gene = EASE cers 7 piselay F geeps > SHOP gource code * | Hincudezsidio: h> int moind) { roar GF 5 ; printt Cc’ enter pempercrs4re rn contigecide" 5 " t sane Cr $8,095 F = (c*ais +3) print CS TM gemperarure in pahsenrit 214A} gesarn dD; 3 pupecied InPUt: ; , Enter th fempercnrt in cenrigrak *20 pepected ousPeur * TH Eemnperoky ‘ im comig facta 120 Gp Fanren hevt = 63 Actual $ Heto convert © ca program © y pene epto9 yo fancennsl & tesuye ! cnt grad Aempercaure Fvo™ sucetsseuvy evecund wish aifsereitt Vales, Scanned with CamScanner Scanned with CamScanner 10. Fahrenheit 40 Centigrade conversion Aim vo perform a program to conwet the Lemperciwe from) Fanrenhtit to Cenrigeack. gigorith™ * gtep | i Stort ster? » peaare CF giep 3° Read F ger tC 2cr-3Urrg gies : pispiady C gees 1 gta ounce code #indude 2Staio-h> Int mainO § float ¢,F) ay pringt (Senter 4h fempercnure in eaineennet “2, scant Cy, FD; =(F-3*5I9 5 prinee Cogne temperate in Gnnigicice ah eran OF i expected Input: prner que in pansennit 268 in censigeo-se =20 ane demnporane 1% reinvent 68 pctuds ourrut > The temperature 10 consign =*0 pedutt: yence aw progecim of £0 carver fem perague feo FOnunniit £9 carsigeost & Sueasssuny etecued SAK fees von: a Scanned with CamScanner om we yc — ‘Scanned with CamScanner

You might also like