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

Pps Lab File

Programming for problem solving file

Uploaded by

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

Pps Lab File

Programming for problem solving file

Uploaded by

Srishti Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 32
PAGE NO, PROGRAM TTL Write first € program Write w program in to print your name, numbers, Write a program in C to swap two numbers (a) using three variablex and (b) using (wo variubles. DATE OF | SUBMISSION SIGNATURE ‘Write « program in C to calculate the area and circumference of 8 circle, ‘Write a program in C to check whether the given number li even or "| Write a program in C to print student details using structure. odd ° Write a program in C to find largest of three numbers, To ‘Write a program in C to simulate calculator using switch care statement, " | Write a program in Cto print factorial ofa number, a lala || 7 | Write « program in C fo print Fibonacci series, 14 laf 23 Wiles pogam’n CoTind evens ofa number and check whether |e ; is palindrome or not, ty Write a program in C to check whether the given number is prime or 17 late not using break statement, > ‘Waite a program in C to print star pattern, 1g te [fa3 Tt J] Write a program in C to read n numbers, store in 1-D array and print pe ola ez ~ elements of array. ‘Write a program in C to print sum and average of ten numbers using 22 lol 123 array. | Write a program in C to print addition of two Matrix using 2-D array. 24 te 14 a3 , ‘| Write a program in C to copy one siring in another siring, 26 [iW Ale> 1. oH | Write a program in C to swap two numbers using (a) call by value and WA fale ( (b) call by reference. | Write a program in C to print address of a variable using pointer. Z49 Wh l2y \ 3 taini23 [7 Program ~ | Byect a Al ze fish Cc Program, te indude th mat ony wy Pelt f (nay name ‘ic Shivang . So) velum o+ Perog-rexm -3 Wisite CT Geelhon ine for addition of two Numbers . Frindude int main () 5 ‘md num), num, sums, PRMKEL Enter dhe fiesl number: ye Seanf("*/.d", demuml)s Prinl{("Enler the second number * " Seanf ("ed") ¥ numa) Sam = naml+ nam: pants ("The sum ef hd num, sum) > ond hd is thd nn", nami, rselum oF Oxkeuy / Enter the Hivst Enter dhe The Number. ¢ Second nuvnbex * s Sum ef 6 ands TA Uy Proyrom= 4 Objek 2 Write 0 preneam Ta C to perform ovlthenet, nD Hhindude Opevabey, \y" ry Osteo Enters Whe feh nambest 5% Envex 4 opexabor (+, -, ae Entey the Second mumbey . The Stesence %e S Reg Se | ac —,,rt~”~=~—<“C“‘CONNRUC:SCSCKSCsrsSKSCseN Enles ane Emtex than Enter the The Ties number t so opewaker s | Seomd numbeys quotient ts 3-33 ee Program = Wate a Progvam, a G fo. cuap) au) O) Using hvee Variables b) Using, 1) Seorpping Ushy Ahice voribles: aH dude IW wind Ik want, uw? temps pak PU Enter the fact namber + Oe seanf (er, Brut) 5 pint?" Enter tre second quumber? ")) Sean g(“h db pum 2), eehd, name hal pani? ("Bef soa pring ¢ num) awn, MOM2) | 1] Sox png stra iver vertables deme = POU trum = nun? mamnz2 = tee! i pafl"Afte, — swappi using Ahvee Vamalles | mummies haf numa = Yf.d\ni, numi, roma I! Swapp 3 aad AWe Venvables usthout ha tempera "varelles mul = UM unt 2) mune F Name = naw?) mam) = NOM t= nUMZ) prod ("Ate y Suoap ry using two varalbles t srumls fe d umes aN" Matin Ve \9 4 mam t, mam? adam > 2 b Sotput Enter Ane feck mombes se Ember au, Second amber 49 Belne AEP Ba oe | Alkes Susapo ee three Votiobles © um 242, ram2- 2¢ Aes as) . Awe Vorighles mami = 26 mam 2 = 45 ; ; Progam 6 a ca and oo Pegram in Cte colealebe The asea Cixcumference Ct a cle. oh indude Hdefine PL 3 idisg ‘’~ mam) § double “ wadius, oven, cleeumferense} prod ("feber tre ads of dhe cicle 3°): Scant (4 2", Krvwelius ) > Cea = PLE sadig, S* redius® cheeumlamce = a™® ore redline 3 PPI Aree ok he ciecle 4 Ayn) owen) 7 PHA FC" Lrecumferenee QAke die FAY WHE, chveamde Facking veturn Os Syren = | . | Wile 0 Prarmm mM C to cheek whether the given Tumbey i, SNM or odd. H include < skdto.ny ww main) § Sk ™ PARE Enter g num bee") » SOF", Yanys F@l-miasnoys PRY d is an SMen amber Vn", we) 3 else ¢ PU L A is om odd srumber Na" an)? 3 wehamn o-, Progam “8 Wite 4 Program Tm C to find lowest of three J Hindude stato. hs tid main § Wd nam! numn2, nom 3, largest 5 Prd (" Enter Meee numbers; ")! Sol (EL LLL nk" Kaul, Vrumn2, Yrum3)? largest = uml! Vf Caumes largest) largest numa CE (mum 3s \angest) largest = Rams 3 PRC TRe loge names fe + or en relay os TIS dy", largess NZ Outpob Pas sles oem = 9 Wiite 4 P09 rCe¥9 WC te Simulate calculator Using ast — case Slobemend # indude WY severe Numbex Cink num) § WA *RXersed Nom 29: uWile (m>0) 5 wa wemalude, = MAMA 101) wenviersedN uy = C¥eWersedNum) Boyt semalnders, Nm] sto 3 Below -ressersed Num a 3 i ih GPAbindwome Cd mun) wk FN vsed Nom [Nee Number ( num) + PP Crus = Fevexsed Nom) § Nelomn UF 3 else q setucy 0 A 3 Wk main () { Wome PAPC Eder Scom fC" of, g" if Ci Palindeome Crom) § PAPC Ad bsg Palindvome \n") num) A A members "ys » Ynom)s alse ¢ t PrWAK Pad Ps mot a palticrame «Wn, num) 5 5 veluin oO: ovtpot Extes a nombeyr 4 ry MU ts ew Palindrome Pro 9 EQ: - \ oe 3 ie & PEAS Say C4, Lhe checle fa oshether the queen umber pame os mot PEA Break Adetemerd ttivdude privd fC" Enter a positive Weges: seamp( "hd", qe member)! TP (momber < 1) § pap ("ed ts mot a prime mombex A"), nombec) Zelse 9 ‘f @s Prime (number) $ PHdF(' td % a prime mumber.\n", number) 2 else ¢ 3 3 telumn 0: 3 oeteet Enter Positive erger : 17 Ts prme number, Evtes a Positive 12% nel idemer 212 Prime numbers. Y “Pron vsorn a \t We oa Progeam Fy, Cay Pir sax Pattern. jeintlude — 20 After Stoapping by Nalve 2 mums 20, raranato Nom a= a Aftex SHEP ping by Relerence + NOM l= 20 » NUM2 = lo au Preayrem - 26 ie A Program MW C 4p pnd aclckress oo yorodole OsiKg — potter , H indude

You might also like