0% found this document useful (0 votes)
21 views23 pages

PPS Imp

The document provides a detailed overview of algorithms, flowcharts, and programming concepts, including examples of algorithms for basic operations such as finding the sum of two numbers and determining if a number is even or odd. It discusses the structure of C programming, data types, operators, keywords, and identifiers, along with flowchart symbols and their meanings. Additionally, it includes sample code snippets for various programming tasks and explains the importance of flowcharts in representing algorithms visually.

Uploaded by

innnu22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
21 views23 pages

PPS Imp

The document provides a detailed overview of algorithms, flowcharts, and programming concepts, including examples of algorithms for basic operations such as finding the sum of two numbers and determining if a number is even or odd. It discusses the structure of C programming, data types, operators, keywords, and identifiers, along with flowchart symbols and their meanings. Additionally, it includes sample code snippets for various programming tasks and explains the importance of flowcharts in representing algorithms visually.

Uploaded by

innnu22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 23
® 4 © a) Debne Mgorithn and th pores, atth , a example. | Algoxithns: feet o-\goxithng iso ster ley _clep “px oce dye os a set of soles destaned to pesto cpectfic Aas > Nigoxtthn is a Cintte cet of vostsuchoos that followed n'a ccomplich bs) complete a pasticulay Yack a Algosith on axe fonda meatal inp fogvamming => Algosithen user eng lich ee nog vage >_Psevdo code is a has leveleof Al goxithea des exi pikion featuver of Algoritthen + Te hag sexvol Lotpox tant Featurec which comtatng » 9) Taput wh) Validity v) Elf eckvenect Bode WV) Clavi by DNATRIKAS, ue: / Lxomple foc a Mgovithe s Q Wee on alsaxithm to find sum of two numbext sol) rep dy Gost Skepa: declaxe the two inkeqexs aS_ayb andigmn Skep3 +, Deine {topet Nheiivaluersolaa anh, by | 4 Shep let Read the valves of oO aad bh: 8 ep Ss Add wo _nombex.¢ Skepbs Pint sum = Seep: Gop: 4 (08) _ Q) Waite an algo xithm to kind oxen of cxcle. = THE had) = Skep bt Shewt E ckepardeclave vadive pod axea = 2 eS = Skep3t Taput yalues of wadivs —— Slepht Read ‘he value of wadtuc bax Skep S» Point Avea —l Stepés Stop. PRATRIKAS, a DvLine Cowochat aad explain sy mba used i» Clow chart with an: exemple. tes) Flowchart 14 a-ptchotal wepweseatation of an algovithn - 8) @saphical sepresentation of ‘an algorithm te called flow chaxt >The mala puspoce of flowchart ts to make the uses uidesshand the code in a easy way > The Aditlesent fymloolé used fox a Flow chayt axe given below! Symbol Tospose Desestption D) ss Flow line Indicates the Flow oF logic ly Connechay syebbol s+ 2) Cc. _) Tex minal, Repseseats the shixt Stout (stop) and the end of a Flow chart. 2) E iopet lovtput Used fox toput & Sapte Output Opesations u) Reo costa 4 vied fox axithmehic : ope: akon = ANATRIKAS, ute: / / 5) ao Decision Used fos decicion making elween two sx Mose a \bexaakives- (08) Symbol Pus pose NED shut (chop > —/ ‘aput foulpub 3) C__wl faksuctions (Peoces¢ vw) <> Deciston 3) A Connec hoy AANTRIKAS, Ome: 7 Example $ Elourchaxt fo Finding apodsatic soot (Set) v v [Read ap Wyieu/, v [b= Sqxt Colt ate) | v Le Kaz -bd Fie] L Ge DRATRIKAS, ag) Write an alg oxi thm and draw a F lowcha vt bo find ue \aageck of three numbers - Cue: f Bed! _Blgortthut Step At Stexk —_Skep?s Declave arbyc valueo and Soput values Sep 3: Read a, bec values chepk: Tf feb .ond asc thea Print a if boa and b>c then print ele petak_c+ Shep: Gop. Flow chawts Gest) 7 eclaye and [ xead arb ,C Tyve of a> als e the We Stychve of C PsogvaM) wih 10) Desert e ue e 1, 7 / an example P8oqxam - Ans) Stroclwre of C-proyann! Steuckuse of ¢ Prrogsain 1s given 10 followr'ag Seckiong + => Comment Section — Pre ap socescoy id ixeckive (ox) Header file => Deltaakton cechiog = Gobel declabion section = Mato Fuackion secon = Sub- Pxo qa secHon. Excamplet \ I WAP to Pxint hello world > Commegt cech’on #iacvdeectdto > - > Header fle Void mata Cd 7 wWaio fonck on P : pxiat EC Hellowwtd); > cob ~ fiogram sachin AXATRIKAS, ae 56) Excelain aloout- Operatoss IN Cp sogumming ite: ff Chest thoeke, selakin Geer ogeanloehe i ag) Opevakos ‘ “Operalos Soa symbol thal pexfosms operations on operands ceath Hese “4’ fs opesartos asd a,b axe operands A c ic sesolt» —_D Asithmetic operators? ~__t) nddition (4) i) Sublsachion ‘tl)_Mulkiplt cation (*) w) division CD v)_ Mo dolor (i0d ola dtuiston) (%) 7 &) Relational, Opexalox i a = less than jz Crseaterthan ww) ce lec than o¥ equd to z WV) 2= Greater than ox eqvall bo es = Equel to “e )_} = nok equal_to ARATRIKAS 68) Exelain beywords and id enliFiens hoe programm ing otite kek keywords and vules fox identifioxs. cs ‘ Resex ved wesd.s thak have spectal AOR = 0. compilex+ Ano) keywordsi bey wouds ave predefined names which \rave Fived meaning ‘fac lanquge + ; 27 eywosd¢ aye written ia lower cose letters _! > Thexe ave 32 bey words fa_C lanquag-e- oka Some of them axe = §) auto W) Chay vit) dovble_y) fox 4 Tien ewido ~4tf) tong xt) goto 4 itt) cage videos ike) tot etd ff ’ Note: We cant use Keywndcat variable. Tdentiffesss ‘identifiers axe the names given to vaxtables - tdentCiess ase Ny HCA oft Me» vse - defined fi Roles Fos _{denti fiers: > de Teentifiess axe case se rcitive fA masc of 3\ chax acer should be used WD write space tS nek allowed between (dent fierd £5) int ftod) “Paice this is nck allowed: : gis, write hasactex most be PRATRIKAS: ) Ynderg, > 70) Explain date Ly pes - aK L Mie: ff [ Ang) Data types F Sarre “Tsienaxy Vaid Secondary re No mesic Non-Wemes ic tate ger & Characke, Feat \ oo Leavy “Types = Ychow Ww) unsigned ches vii) siqaed chay a) tok W) vnsigeed int vit) signed int i) Float vid) unstgned Flea: ix) digaed Heat ®_Shoxk xt) long Q) Compiler and fotexpretex Ans) Taterprdes : (ntexpretéx will compile the code step toy ghep and this will take moxe tyme 4o com pile full code then compiley- Compiles: Compiles will compile the code Folly af ao tone and this wil) tobe less time then ‘inlevprdex: DAATRIKAS. ( find He — Multiplication of hue Avabers 8) Dsile an Algosithn 4o cb) Ged: Seat | Ghepr : Mec lave abr ¢ valves, Steps, MAE &fine aand b values Sep: Molkiply a and b- Slept define 6 98 rocult Jootpvt of Stepe Shep & Print& \ Sfep7: Stop Cede Joo Adding “tne nvmberce At include void mata fot arb, C3 a0, bbs ateC: teint EOSon= %d 07 y 2 Algettin 49 Fad He macinum of Hiree nonbes Sol) eps Staxt Skeprs TRead the Hee nonbers Fo be compared pie x YSB-_ Slept: Check WF = is grectes than ‘ SH dee, check tPse iF quater tan? Dhwe pret the valve of DE Mase -Peint Be valve Fz mF Gse, heb it yw greater Han @ . F tue, Rint tevale aby ) i false 7 Point He valve of 2 f Gep & Eng es §) A Dsite an algositha fo Bind the gien numloew is even 2) 08d. Keep bs Stast Ker: Tapd number Key 2? Remainder. number mod 2 ak SP Rew = O then Rrvint given mbes ie even else given aombex is odd. end *f Geo S+ Stop B)ovile an algovithen to Cand sebeeat given nomleer & abt positive os negative. eh) Steels Start Seep? Tr put oumboeat Segat iF (amo) Print norboer iS positive else pxink numbers is neg ative - end Step bs Stop. D crile an alositen to eink given umber is divible by © be) nck Chop 4: Shox, Hep? Read geen novbes ep 32 vers Hua%s LC (emeo) Cxint divishle eke at divsble - Che: Sop Faololew skotement: ) Core elt ccnn fo Find sina \est of fo Numbexs. AHinclyde fale Gee) DDsaw Flaschark +o Lind given ounber fod (od) exey- Cstart ) Tapue ovnleey . ¢ we i Fret 7 [87 DVDrvaw a Howchayt Ao find tHe qiven num is divishle Ly §(e6) not? a GD) aetna Declave nutnber | L Read ounbey | Rint nc divisble Ss B) Draw a Flowehatt be Find addon of oo numb ext «®) GD clase ets oi and & and Su J Regd arb uv. Lv G) Feewdo code Lex Finding coreg oumlbex ssnong bag, > Stat and declave arb Read ab i ach thea = Prink o issmaller ” ese > Osink Lo Uemalley > shop ) Write “Feevdo code to Lind ren nombes U odd fs eren > Stost declase a Read a > tf avacco then —> Pxint a iS even > else J Peink ats odd > Stop. @ Wake an Algorithn , Brava Flow dart Ao Find yogts & a ayvadwatic ea) Sab) Aly ostfh oa Step d+ Gtaxt Stepr: Declare He vequivd vaxta.bles Slep3: ‘indicate the uses to eater He coefLecients of He qwadsatic eqakion by dts plaging sortable Sentences using -prinf EC) - Seple: Lanchion Fox te user to etter te Waik using Me scant C) Gaputs ; Skep ks calcvlate the voots of quadratic eq voy fox mula. SkepS: Display. the ves ule Steps. stop Flurchast: 1)Area of circle: #include #tdefine pi 3.141 int main(){ float area,radius; printf("Enter radius:"); scanf("%f" ,&radius) ; area=pi*radius*radius; printf("Area of circle is %.2f",area); Mi Py me et) a #include void main(){ BAe Ka py printf(“Enter length:"); scanf("%d", &len) ; printf("Enter width:”); scanf("%d", &wid) 5 area=len*wid; printf("Area of Rectangle is %d",area); y 3)Area of triangle: Es Ufa kt Staab cent pte =O) poe tail ese ary printf("Enter base:"); scanf("%F", &base) ; printf("Enter height:"); scanf("%f", &height) ; area=0.5*base*height; printf("Area of triangle is %.2f", area); } CONT Mele) =tar- Meo yo cM Ly <0 a STILT Ley #include void main(){ pL ae er) printf("Enter three different numbers: "); scanf (“%dxdxd",&a,&b,&c) ; if (a>b&&a>c){ printf("%d is the largest number", a). } Pha (heehee E printf("%d is the largest number",b). } Pag (bans obey e printf("%d is the largest number",c): 2 Yi 5)Write a program to check whether the given number is‘even or odd: #include void main(){ et ary printf(“enter an integer: EST oo” at Sy ie eS printf("Xd is odd",a); else{ printf("Xd is even",a)3 } by 8)WAP to find year is leap year or not Stale Ale (Sate Kee by void main(){ int year; printf("Enter a year: “); scanf("%d",&year) ; if (year%4==0){ printf("Xd is a leap year”,year); else{ printf("%d is not a leap year",year); i i Cy mee ie EM ees #include int main(){ Carat 4 int lwr_c,upric; printf (" Gasp e ‘an alphabet: “); ri if(c==upr_c||c==Iwr_c){ printf("%c is a vowel",c); } Erte printf(“X%c: is:a consonant“5c); } te } BCVA. aoe eee ae eel aed Eat Te [eet Kee bg int main(){ Si) war: Pod) printf("Enter a b values:"); Scanf("%d%d",&a,&b) ; if(a>b){ printf("%’d is greater than b",a); } Cy printf("%d is greatest than a,b); Mi 11)//wAP to find number is division by 5 or not #include int main(){ at at printf("eEnter a value:"); scanf("%d", &a) ; pha TDD printf("%d is division by 5",a); My else{ printf("%d is not division by 5",a); i

You might also like