Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
18 views
PPS Unit 3
using C
Uploaded by
tpayu740
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save PPS Unit 3 For Later
Download
Save
Save PPS Unit 3 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
18 views
PPS Unit 3
using C
Uploaded by
tpayu740
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save PPS Unit 3 For Later
Carousel Previous
Carousel Next
Save
Save PPS Unit 3 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 27
Search
Fullscreen
>» Loops ant tue +o Hepeat a gree of aderment naepeoted Ly ein c pr ogHiomming - (for Loop + > The por Soop 1 used +0 gerovh of statement s1eptod edly > Td exprepes with toop yoriable (4) > > The Symtox of for Loop '$ given Oe follow s'- eet us zcthion, corci#on, indyemsnd [| oK Loops a Loops ane of tri ty pee execute Whe _ Syntax for ( initials os cl crement ). Group of sHiiremenks ? Dot Where initiolizaHon = ctonting value. + Condition = ending vole off + Tnanement = fet os js f4#t. © Decremens = i-- ste PetQu: Waite a program in G FO genirtoste ie RIBONAce! SERIES Seid FE tnelvots ¢ gtelvon> H- IIneluotse Cceninh? Void maint) & tne ot SCaonh Chol hed fol" tq, £675 Z for Po : 3 : gp. Cet S185 yin) ‘ Cr arb, PUSHER fol", oy a= b; 7 Stuap values Sune: Lunes Boer? Wotite, a program jn ¢ to Cheele Wrhuthin HK nes in DRYSTRONG NUMBER a met, Sol > include < Stobio- h> [Rho of 44g te inctude
¢ Void maint ) to 2 N/o+ ocf Loo} int 1H, Summits Seanf CS ZA" End; for( ian 3 Miso} ‘=i fro) ; 2 Piste sions See (st eo wor) t Sum 5 4 a : Pe tho : aeQuest: if ( n= = Som) 2 " porinah CT ARMSTRONG: NO"); eet ae ( "NOT ARMS TROND No") 3 geen QO) 7 Woride oF porogram do chetk Whether 20: us is PALINOROME °F oot H include
Roymre, ovder = Ovid HE Include
eA tay a ae vorc man C ) g ae URS Sa ay Hi uri Oy Scon4 C fds faa: ara fer (fen; leo} jsifo) & vie 1710; Sum = (Suro €10) +4 ie i fio is if (Sum == hn) uae Rio ie Pod ny print ( No is Palinebtory")), One Printh C* Newt's net Patindione any A: getent )) 2 -hoe Wore #0 print +he e _ potogram tac 1 my 7 6 UT blo 1 Lio in Juyense 8a > TE in clvete
include Ktorvohs VOrel mos, @ . int ny , Sum = 05 Scand C hel", £ny fon (r= 10; fogs j>j-2) Sum = (Sum th) * NESTED Loops~ y NJ Sted loops au those Loop in Which bone oop ix CRE Coded FMSicly anothn Lwop: > Genecatty Nesteot Program, . loops We Wud Patton eerGuess WoO Program in C +0 gap erede gmon Potttesan + > Fe Inclode
+e include Void main ©) a Ind Kooniah > 1: 7d 5 at Ciery iguy itt) ata z Foot (gery J£35 511) 2 Printh (" wortp")} = 4 tho)) 3 Ques Woarte cq ptogyom in Cto gintrode the given Pp n: — st include CStdioh> include < Conio: h> a Ss vord main 0) eee t eer hay ooy * int ty 4) ; for Gey 855 yt) See aes for Gey F415 G1 pig Cry 4 geteh C); ai: Qe bide a program In c +0 genecede the — + include
HH ineclode < Conioh> Vora main ¢ ) Mt Ty 4s a re Ly JSS, a) fen Cx a 4)5 al 23 jee C)) Que'\- White w program inc +o generate ths Potten — tH inclode
HAL /nclude
vord main ( ) é Int go fer (iz iss, str) [eo 55 OB 5 gre Cay; 3 a Jeteh ©); JU yy « » * » * yoy x”’ Boe White & pstogram in ¢ 40 Gennrede TAK give, . Po > HE include
Sey HH inetude
as | Void main ¢ ) . ins 4) irgo[> 12 13 | Peach cota ; Tope TeCisa, ges y cer) iaslt (2 4 2 cel t fo) aly fe Cats Isis gt) d Peete Chk 5); 3 Ch cy ait Ques’ Wbsite « Pxogram inc to generate th Patter — HF inclode
ay le le lx HL include
vow y void main ( ) Yow ye ct : . eo» T int 1, 43 fer (iz Uy iss, str) Ce ea) poe Clays 4 getth ©), =p * goss Poogr am +o ganenecte gnen pablo. > te inchocte
ah Include
void main () f ‘ nt 4,45 vis for (deg; dois ict) : E ° | te(gets gsisgt) Lu Printh C8 ha, Gg) 5 % yteh CD; 4 doa Raegram +o gunowse given paktorn. — tt include
4 te include
void main ©) =f S 4 2 ind Jy 45 0 foy (isa; x c65 it) a | 2 forldea dst get) o prinadp Cea 3) 3 & gech C)) 3os ey patton, Ques! Program te gre é ~? FE inetude
ch Mclode
H include < Conio. AD void main ( ) : bd $ eet [re ay gale teas for (iss) iss; f+) / — é bea) feilget jesus jit) g . 4 Po 3 fey Ck25 Kea; Ktt ) ei Printh CS x "sy prsth C\n *); 4 Geten ¢ )}om USE of by and continue Stottrmungy 9 SC 0 tak \ OA Dienk= ) ae base selon “Lot ———* ee Conclton, TASH the Loop within it bthen break Statement tht S IS & COUN Ferret "544 loop tne pxogram condos Com % oy, oh the loop fore celly or ABN cepey &9 > Of break Stodiment. 7 Write aw Progen, | =>.t MUvede
Continue statement _ Unlike bre aks Stodemer she continue Statement ore dwins the program control back to the loop: > THE Continue Statemtnd i's also Used insicle tthe Loop and Within the if ConcGtion. eg? of Continue S+tatemen +: te include
tHinclode « Stelio.hd At inctute
H jnctude
> The do white Loop %s Wed +o LXE Cote the Yroup oF stodemunt uprated ty . > The Syntax of clo -while loop is gevens clo é Group o Stoatemaends} Uthite stoop” ) > Floes Chant of alo White Loop i's given as ote Difference blu whit £ do Whi Loop + Lhily Loop Qo errils Coop % ThE hits Loop Tr cle. white oop tH ConcitHon Is evalvated | execution of S+tedement> Pisst and +hen tates place first ond execerton of Statemends Condition i evatuek pedkes Place :q J loop w To While loop , dy i, # Der ele: eerie f ecection of stoderunt not mandatory thes * y with tate place fox ERCCUHION of Stodemend oF Stast- one tins will Fake place, => NOTE? , ¢ d , H+ Buea Ro Nam +o Chede on Armstrong no Using do while loop. — # include < Stclioh> Hinclude < contoh> void maint ) é [rt WA, 4,4, Sums Oo; Scans CC" hb", boy rou clo re if105 Sum 2 Crayne) ¢ Sun, Te (Ploy, 4COAL @l=0)> If (ra Sum ) C ) PY” Armstrong No") 4 f Clye é PPOth ( Y Not a nse Mo?) 4 geten © ys - HH EUNCTIONS+ FF Include
HE Inclocte < Conjohys 7 “eheeetverel @dd ( H+ "prototype (ot: ein) “bro VO / ol mon( ) as Gnrg mnt a, bt Stank ("hd ral ", fa, tb)! Feattise, a el a Ca a) fen Pe = idl Lue prov’ Cate by value, ce rman £) A tal add Crnte riIntd) — fon ctron olefins tion m+ery Curhosr ia chon @2 etoile lined f J eat) aPrnth nay eps ae Cotectovu2¢_Fonchons > A function is a block of Code Which execu +o perform a Speci fic task. > The aclvantege of tet'nre mathiple Sunctrons ( Usest cl €rncet Functions) mat program matey, the Pregramming cary to Understand. => Type of fonctions +t Theu wu two Categories © Library cliFined functions + The olfinitron of this Ffuncdron is altura by precend in thy C fan voge . egy man) , TAH, — SCamp OI, printh (> 4 © Usey ol Frineel fonctions + The cefsnitron of taet These function 1S crcated by the LUeH. Crt could be any hee except tb weoiay fonctHon. OF? cdi () XYZ), ext ) et. > Components of function = There aie 3 components of a fonction + O fonction pototo ty pet > Function prototype Is clear ocetsrols ths main functon to give an rchea of Hating OAM chidintd function , > The Syntar ton ction prototype rs given as Fo! lows — clata type f” nome CD. © go Vvotd add ( )ae ON © Fonctron calling 2 9En Functor Calling ~ wh T+ Ong Ffenction cally Fanother functron +o POR, Some task. 7 Tiss Lyn ta x of functron calling rs given or Kt, ” M ft Dame Cearameters) Q fG- acl Cab)) © Fone ton af nition + This Compontrt Conteun, of cCocte +o prtform Some fark: a bloc The Syntax of Function ca finiHon is given ws n Follows Aepetre Snes nga vic aaa te ring Block of techs eS ze: % ezct+el Print Chl) J GHEY, Ques Write a Petogreun to C+o Swap thr valves of +0 vaxiable using a thisth vanioblu with Cau by volue +tchWique — > cH inctoude
AH tnclode
void mein ©) void men ( ) @ Int mh YSQue WHite a progam in C to Calcrtate factor ic of ano. Using Call by valve method, —-» include
He include
Void factorial C ey void man ( int 9,4, Sole 45 Scanb (wheal ny, factorial (ni 4, Sot), gen’ yy % void factwuet (ingen )) inti, Int sol) g for (4-4; jkny st) é Sls Sol xs; 4 Printh(™ Tick” Soy): zChoeg! » coo © AO theete am fn WWoeiye a porogy es WI Oday homer tuing J Vali che Mebuce “e stection he Ht imelude
Vorel aimetvong ¢ J latory MDiol main ¢) C Mma act Stanb Cra ", £n)5 OOM Soro Cr )5 Jere ¢ J % Void cumstrong C int m1) Ine a, wy, Sum = 05 Foy ( (eo lee, te 1 iio) Rie eros Sums Ot x) 4 Sumy 4 it (sume = ww ct Prin th Ce Prstrong No")} % clye 2 | “Not Are strong Alo"), it ifrosQues’ Waite a program Inc Ww Genmate a —— Libonaced Senies of 20 numbeus an o print ts wing calling by valve- — > 4b inclucte
beats th include < Conion> vole Fibonacci C ) vold main ©) : frase HOH Scon+ ("Pd Fd" da, tb); fibonace) Carb); grea yy 3 Voice Freonace; Cink q, inth) 2 Int su, C, Sums Oo; for (i=4 5 ix 20: i474) z int C3 C= ath, Qa=b) -be Cs Sum: (Sum ac)} 4 printh ("AY O)5 %= fe. > CPrp,, “a Cathey vatve (Pesiit) | Catt by Rea man ¢ ) mon ( ) $ Sa OSH] fae] ST fst ew 4b “~ oeeey % PLO vay, > 3 OHm ( ) win C ee SS ; atin a e prt lOO a ay eine Zod Somer 0dr} [zor] [ae] ga ee ar) a 4 iain desire einie sie he Cwovlts on WorkKA 8n iginad tp 89 photy copy” e py) — Pointe; variable Stoves Adcbiess of vwriak > Ine *y — Stores, enty int vasciable > Chan * yY —> Stores cr chan voodahit, > float * Y — Stoves only Float variable: > clouble * y —> Stores ently clouble voor able Hh Col) by wefvrence + 9 Th cat! by srefurence OW fonctron Pomes tht addres of varjagl + Gnother functions: > The fonctions that CALE i Calteol the bobbing : ; CohILE The Second function 'S Called the ‘cated > Becawte the addres of vartables 4. parseol #0 another fonction, the chan Mack by fra conte functron On ths acleluers of vourables crcl abetthe valu of variable present in calling fonction. Gues = Wutite eo Pero gram Pac to Stwuays two Numbers tuieg Cat by Ute Bence. — > + Include
th Include
woid Stomp CIB void (ins Fain tev NY brine void mein ( ) z Int % 6S Stang ("Lodho", La, to)! — Sends ab b with adduerr. Swap a4 5 =H paxamettn (Catt by veference). Gtith Ce % void Swap (int *a, jnt™ b} int oy a » volue at adclue, Stoud in b. ee x b; tb = * a) Bq 2 C5 pooh Ld fa" * a fal) ichaie laity aapnden Vaiabic+ 4 Quer Wout ce pregrom in of a no. UA cau by wefrence. to Sind the factorial=H Retin Stetemand > Void J’ name = The f? will not retin any value. Dnt eS name = on retin an tndegen valu > Hour f’ names tpt eet — Me Chon vedi n Cloubie volute > Chon f° nome > doubb £” nome > im usy Eq? ( ) inst mul ©) arnain ©) man | ) a - _ } \, ti add ©) int 2 Int ey “| Lz acd ()), es divs *Sub ©) eh ; \ ~ehurin ©) Genet) rector #0 int add) i tet Oe tO pay O) ink : sa . i stoyezrnod \) ge see, az mod) Ger dene| [at ordtuin Y) yetuutn d) P int mod) by int SUbC) & t . Intars, b> 6) \nt 1, ines me mult CO)! Cz atby Hu mS . wd" . FRIORIES PS pande('7", 4 orehuoin ©} 5 Note+ [us we We voice main C dg then we hoe ‘snot fo One rerun O- Buk we ure int, Chand Soon, flows maint) fh te necemany fo Ut ¥CtWwIN "_” fomitiing J, Important points +0 wrt meron stedemand S The netwoin ‘ododtemauncd used Urhin the “tolling § caus the Caled £°" to petform Sora task anol the called ff” har to vrettuinecl the valtu bac to Caltiag £” >To Use The vretuin statements, Aotatype of f™ must be Changed - DOL try J? haw void dose ype> pthan ne valu wilt be ne dunned -the dS” has int clata type inttgen value 6s /'y be 7 " u Choy Chan value u . ca « flont 0 Ffook 2 ' » deubte «double» 4 Qoes:- Lbiite a program In C to adel Hv0 no. Maing cS” and alro yestn th vi , =. Pe inctude cstetro Wd #E include
Int add ()! int mmas'n © ) & nt & 2 Asada ( )! . ea Hee printf oso can be vans. ote tin 9D becaue MF Prine ft Det oy A necerany & 4 (n+ adal ) in main ©). int Q>S ) b= 6; rat Cy cer arbhy Pootge CO“ 4a" © return C 4 J y
You might also like
Loop Questions
PDF
No ratings yet
Loop Questions
18 pages
C Programming
PDF
No ratings yet
C Programming
7 pages
c programming
PDF
No ratings yet
c programming
26 pages
C Programming
PDF
No ratings yet
C Programming
42 pages
CN OBSERVATION NOTES
PDF
No ratings yet
CN OBSERVATION NOTES
33 pages
C Language Notes
PDF
No ratings yet
C Language Notes
97 pages
Data Structures Unit 1 - SVS
PDF
No ratings yet
Data Structures Unit 1 - SVS
21 pages
PIC chapter 2-Control Structure
PDF
No ratings yet
PIC chapter 2-Control Structure
30 pages
Pps Mid Important Questions
PDF
No ratings yet
Pps Mid Important Questions
42 pages
C Programming Language
PDF
No ratings yet
C Programming Language
55 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
Byts Week - 4
PDF
No ratings yet
Byts Week - 4
18 pages
Lab Report 3-4
PDF
No ratings yet
Lab Report 3-4
47 pages
Control Statement
PDF
No ratings yet
Control Statement
36 pages
Chapter 4, C++
PDF
No ratings yet
Chapter 4, C++
25 pages
BCP AB
PDF
No ratings yet
BCP AB
65 pages
2Nd Chapt Fybcs - 10 - 07 - 2022 New Doc 10-07-2022 14.06
PDF
No ratings yet
2Nd Chapt Fybcs - 10 - 07 - 2022 New Doc 10-07-2022 14.06
11 pages
18CS752-Python 4
PDF
No ratings yet
18CS752-Python 4
16 pages
CP ASSIGNMENT 1..
PDF
No ratings yet
CP ASSIGNMENT 1..
15 pages
C Notes
PDF
No ratings yet
C Notes
44 pages
C Language Notes-2
PDF
No ratings yet
C Language Notes-2
40 pages
Java Notes
PDF
No ratings yet
Java Notes
37 pages
Notesof C Language by Abhay Kumar Awasthi Till Recursion
PDF
No ratings yet
Notesof C Language by Abhay Kumar Awasthi Till Recursion
27 pages
Basic Handnote of CSE-101 Course
PDF
No ratings yet
Basic Handnote of CSE-101 Course
43 pages
Pps Lab File
PDF
No ratings yet
Pps Lab File
32 pages
3rd unit PPL notes
PDF
No ratings yet
3rd unit PPL notes
19 pages
Programming Class 5 Note
PDF
No ratings yet
Programming Class 5 Note
68 pages
C
PDF
No ratings yet
C
25 pages
Python question bank
PDF
No ratings yet
Python question bank
13 pages
Bceq I I PDF
PDF
No ratings yet
Bceq I I PDF
171 pages
Engineering Questions
PDF
No ratings yet
Engineering Questions
162 pages
C Programming Lab
PDF
No ratings yet
C Programming Lab
39 pages
Unit 3
PDF
No ratings yet
Unit 3
19 pages
Cs Notes
PDF
No ratings yet
Cs Notes
28 pages
Unit 1
PDF
No ratings yet
Unit 1
59 pages
Lab 2
PDF
No ratings yet
Lab 2
21 pages
Topic5-Introduction To Loop and Using Loop For
PDF
No ratings yet
Topic5-Introduction To Loop and Using Loop For
21 pages
Chapter 4 PythonLoops
PDF
No ratings yet
Chapter 4 PythonLoops
28 pages
1st Sem C-Programming
PDF
No ratings yet
1st Sem C-Programming
11 pages
Programming Class 9 Note
PDF
No ratings yet
Programming Class 9 Note
36 pages
C Language Assignment
PDF
No ratings yet
C Language Assignment
16 pages
Computer Past Papers
PDF
No ratings yet
Computer Past Papers
14 pages
CP Important Question Bank Which Can Come
PDF
No ratings yet
CP Important Question Bank Which Can Come
32 pages
Lab 5
PDF
No ratings yet
Lab 5
5 pages
C Programming Written Notes 1 Pages 1
PDF
No ratings yet
C Programming Written Notes 1 Pages 1
100 pages
Assignment
PDF
No ratings yet
Assignment
33 pages
python notes
PDF
No ratings yet
python notes
25 pages
Important Topics
PDF
No ratings yet
Important Topics
12 pages
all time favourites 1
PDF
No ratings yet
all time favourites 1
3 pages
Prem Ass 2 Python
PDF
No ratings yet
Prem Ass 2 Python
8 pages
MCS-011 Problem Solving and Programming
PDF
No ratings yet
MCS-011 Problem Solving and Programming
13 pages
Computational Method Note
PDF
No ratings yet
Computational Method Note
30 pages
OS Unit 2 Part 1
PDF
No ratings yet
OS Unit 2 Part 1
15 pages
PPL Unit 5-1
PDF
No ratings yet
PPL Unit 5-1
33 pages
C Language {Unit 2(Part 1)}[1]
PDF
No ratings yet
C Language {Unit 2(Part 1)}[1]
20 pages
While Loop Slides
PDF
No ratings yet
While Loop Slides
24 pages
Week3 1
PDF
No ratings yet
Week3 1
89 pages
Unit-I (DS)
PDF
No ratings yet
Unit-I (DS)
67 pages
Assignment 5 Environment & Ecology
PDF
No ratings yet
Assignment 5 Environment & Ecology
1 page
Coa Unit 4 Notes
PDF
No ratings yet
Coa Unit 4 Notes
45 pages
PPS Unit 4
PDF
No ratings yet
PPS Unit 4
30 pages