0% found this document useful (0 votes)
22 views28 pages

ICT Chapter 5

Ccfddxf

Uploaded by

Hridoy
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)
22 views28 pages

ICT Chapter 5

Ccfddxf

Uploaded by

Hridoy
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/ 28
Chapter aneerr*" “Rrrogtomniming Language.” ¥ Reogreame. - naa + Longvoge - 6131 aR | een Roy «Gu: REA Saareor oyndi carnga mer BIC WA u Programe aro XS] EME WTA A eT Computer ag CRS ares Saar ROA Command 7 chara TGR Aroqrame Tel | D Pr ing L Ogrramin Ing anquoge ar \ *Q STA Hass BA Programe G2) 2a Oma Programming. Lanquoge 2) &TS| Tay Sygate O.d44, CH (¢ shone) , fethen. Basie Fealitans Java, Cobol... * Rrograme ag arta aN SoPfwane. Application (hep) + SoPlwane @ Cid Wier Keel Ka] 2B mM ob: © nAwOtT Me 24! @ DPT Bigs xm © AHR ge a) RS CA FA HT Mrograme Val awe OTS RH BAG 2A 4 Algorei thn - ORINGTR | 2. Flow-chort- Aalea | 2. C-Freegrtomm Coding. = Algorcithin RH? ¥@A) WAG) wadiga cy Saree wogenr Commond ag false wera Akonithm al \ & ‘Algorithm ante aR oR Progam 2 TTA GIS) AM rogram aa Sewegy FA TOs x > Ad GAT Program gar aga : > att ATES (GA aq TO AT Akorithm aa wes B Algorithm ABTA QKA Ber ae , ¥ AA Program ag, wy (Afar Ww Ia * casa Gunlea Grecia %~ TAI * OR ARTi@ MARt Fa Aatagare SETARNETA. NOTE . ¥ GAT BAW ws By GaeiW oI Command ad (faa 67H Plow-chant aii >Ploo-chact was Gate ear Preogetomn, > Flowchart mar Program Fail ATH qe ANA 1 2 aA Gat aaiga fan I Bay ND! > Program aa Plats Aq GA wr & TENA pay WA! > Algorithm Aq RUMAH MH VEl Flow -chart, > at ACS I REL FHT VO! A SAR A TAS BIRCY Bers" esRe | ar aa / aT oa GIB] Progrom ag y/AW RT! | aaarseas | Input as Output (ene, Fat CITROEN | AMRTIRATTA SF IANS = | Saw [ad/ary ORC Rew 2a OBIA Bg | PROM AT GIT steer (ip) HA —— FV EH | aren Bo) TAL mE oy sme) o C- Frrogitam Coding : * MAIN C-Aroqaam ag VS GPG GIT XT = Bosie Sueture of "@* Program ( vt {17) a. Library Program 2. Plain Retion , 2+ Variable declare with Doda Type. 4. Input 5. Process 6+ Output 4. Libnaty Program wannnnnnnn dont Rate? # WICH GI CTE Program (4H e158 Progaom Lbnavry Program ers , : , 2 Library Program Grup © eR) A, # inch, Bod include < stdlib.hs 6: # include < string h> TH inclicla ¢ Usa ls DLilorory Frogrcom - aq Gureat :- # include %) # inelude < conio h> amt, ¢on=console, izingot, 0= output, = OTIS Output ane as Riegel BEA RIS 271 2 BR frognam 16 REA water emT gefeh ( ) Wart BI ME Rs, # inclde < math h> > Rers sitter 5 Hea (AGC RB BATS = © Power + = Pow(a.m) ® Square Rant: Ye = OSE) str MER VA! @ moin ¢ ) ® viod moin() int main ( ) 2. Data Tyre - Gtr ber DARI Www SYIIISALIAE A Dala ype pare & Aa) 2. Built-In ar Gam Gr GAR 2. User DeRred - (Obl GRE 3+ Derived - (oh Bs * Built-Tn ar Gi GI Tyre © fA! 4. Tnfeger (at) = 2» 10+ 292 2. Floating point (Flot) 2 125, 53.93, 5% %. Chanoctor (char) = @d Gre, ry * Gr Yee @ISATA HIN > Br Achar = ink voy 5 > Gor Srey = Float uy.2s 4. Input - 3a 2 Input ASIA GB seanf( ) aAa Raw =i > GIA dnucture (B aa sean? (‘Format Specifter’, & voriahle nome); @ Format Specifier a * Input Gem Ba Output hous es voriobl. ad Data Type az Mae WEEE Bamat - Speafler AGI! Uses Dacta Type —— Format Speci Rere @ Char ++ OP kT ( * aay vorioble name aq oer’ s' Ale waar aed aS ZA) '%' AfE@® Modulos ar Absolvle value qa > SeonPC) aay PRinthC) Gsa Rnetion a ‘x! modulos Baa a1 Example: S16 TeFarasr att Be Saran sie Input (ou (IG s- seanP("%d “P", ga, Be) } ’ 5. Process - Afamaat ANA AAA AAAARAR AY 2 Process Srest- sanfqanke mfafean 3a, Conditional Stodement , aa Locping Statement “AT 6) 1 2 Looping Slatement \o Sacra 1. fort loop oh 2. while loop 2 do.While loop : > Conditional eddment, y “iP, eke, ebe..iP o MAGE Wars Path - Express: hon 9: ‘Expressition KY eR + = / (sash) Qo” ~ Pow (am) ’ te ao Sgt (3) {re| — abs(x) Vy — Cbat (xe) eres = mod ar % | Nole+'G' Expression waht small latter 25) 6. Output - CREB Rr ernenr 2 Oulpl @oura ey printf) saga FAG 1 x Stavalure:- print PCronmat Speai Hest variable nome ) 5 Example: 361 Ref BSAT aae oP Sana HIT. Oufut Gorula Gi - printh (rd xP", OX) 3 Orr.0y. Bate Ararat ALF.e AB? 0). Algorithm AaiRFR-:- Step-t! Start : Step2+ Input Rata gid aesr a:b et | sep + Sum=ath ACR! slep-4 + Output t Revd sum rat 8 “ slep-5 + Ead 02. Flow-chaet Aamqe—;- - Gon Ainge: .16,/ [amzarb |, J Ookek sien / CEna_) Ob." Reagrcam Coding # inelude. ¢delio+h > © void mixin () int Oslo, Sum 3 seanf(*%d xd’, 8a, &b)s Sum > Atb 3 print P(%d ", sum) § AE ore AMAT. BATA, STI HG TAI A Pee we? Aon: Gis eras aS AfEA AF ee AY? we 03. Algorithm aa Gangs: Step-2: start btep:2: Input ROAM Galt SWB weghee By Step-3: SUM = Vty+2 ART chep-4: Average = SO aman | shep-s : Output a Average aa apt aa Step-6 + End 02. Flow- chart Aa (ARPA :- ow. @- Freoqram Coding - (ASAT e- # inalude yoid main ( ) int My oR. Sum; Floot avg : seanP(* rd zd vd", u+ SY> be)i SUM = KtGrR $s ovg = sum/3s print PC* re’, og ) ; 5 8 oprsr art Preogrcamming GATT ATCA ana/ oR v Tr > GAFTETMA/ CAEL OA = 2. TIGA > F . Coy = k x Sa a> ge aras’ [e-F [ek [e-e] eu [u-elu-r | ig a 4 F-3h - war of, pe = PAE 08: ARR GATT TIGRE CWE BRT Mam A,F @ CCAD ON BBA, O+F @. Foe rr) > 5(F- 2) = 9% > F-32= % > FF Oe oa » F = M42 5 eNdle: AATAD VOY Aosa ONAT Ay SA Tee WEA CU @ Fa eae sata Algorithm. Step-1: Storch Step2:Inpul Rear © ad aR AArs step-3: F= 28 4 a2. OTH | step-4: Outpol a F ad SIR qtr Step-5 + End 2. C'R"F" aA Beer Raa Flow-chant ~ 0. 3H BEA C-Aeogrram (sont) # include foot: €_/ possi Floot @.f $ | a Pra, Joule € / P= ((oxe)/5) +225 Cind> print? (1xP™ F) 8 } Noles amare Wace CR MACE Va wv 0 (agGra APA cps Preogecomming eka 2. (ARE ia] = tx beh 2 Lx bose x height 2. We (AEE faTRl = Bok fazaea ts | o. apie (agua qa > Tarr 4. Ramg Rye avast = 15-0) Go) le) 6.2 Akbse ° 3 aura 5. awa @Paunl < ae A083 :- GER, Aram FIG AP ee AW) 02. Algoni thm - Ga: Gaza: - Step-1 + Slant : $ step: Enput emma gf (&) aa GMer(h) \ut 7) aa ST AR : slep-3 1 Areas bx bx h AG, Step-4: Output A Area eset 1 Step-5! End, 2, Flow-chard aq (Ase! G cae Logis) TC we eu ali tf include, gbHlioh> main(, ) Ploot bh , aren SeanhCs of af", 8:1 5h )s aren = (/2)\xbahs printhCaren of the triangle, is np" estan) s }. a Bela tenilia Prrearzam NVumboy - Te faKT Peon eas CE F Ewen (or) mumbo dat ? % (0 Sh swyenran 2 GIF! arse aeacet GIG O20 GR Cane aiesP FEI! Exomple: Fan 4 gar eer aap EMG FS) Feed. Lined Cinecdutas = nee) 4|zle ; sa nerd: eae , 1G imal 4¥o3 ; Spee: Gath casr ner aie Gane OF Gage APs @ GF” a Algorithm. a8 (gat Slep-ot: Sdaret- step-02 | Inpud ew ANI esr ar Aya! slepertt wai wea: Big Cufpul ® Eveq TA Sfepeotes ePisaTeh Oulaut a “Gohl” air, sSlep-08 End 2. Flow-chorel Ga ARI s— Ge Loos: ix / b. C-Rrogramming Coding =Ga (suger i— include Algorithm Ga (eR 3 Step-or: Stenle step-02: Input Rela $216 Asor xy BR step-03: Uh NY zB wae Oulput a "Kis “the largest number." Grrl Step-04: GTTSzTE..oufput “@f is the largest number “rate Step-05: End 2. Flow- chart aq (ARRA- 3 - & Arogram aa Ana #f include. Ue) s @arod: (Gave awe hs BON Wy BTy (rica Ww ALE OLY). ; »-Algonitm clep-o1: Start Step- 02: Input : (GATE NWI Woy 7? eR, \ Step-03: AH K>Y A KOZ W VAS Outer ate the longest number ” Aqaer chep-ohs GPRM MH YM ae YPZ 2d ORS Output a *Y is the longest number” Aratt Slep-06 + GFs2Ta Output a*Z is the laregest number* Aref Step-06: End. ‘oO 2. Flow - Chart -Ga (aygsr:— G-Fheagnam Codling Gq np # include <étdio h > void main ( ) inf Moe BS seanP("%d xd nd“, oe, AY Az) : iP Curvy ; & ure) print had "4 %) ; ele, MCgru Be Y72) print P Cx" Y) i print fC xA 12)i 3 n4ar mantic Algortt lies. Plow -chond so e Reegream 0 sam aq = t fo [2 Gar ‘ary 6 ate « inifiatzelion [d= difference) gat ist4 dfavosd et ATA ue » (up oe © cana = Som sa 2 gummadibn Ae Sum = fume b Note: (OMe GAA mayen sum=0 ade OPE GWE Hara sume 4 - 4 Example a+ 4 + Rf lod Pe tN ARTO SH amr bet , be ito: aT: sum=o. sum=sum+ b o = ott a Roe a+? i ya TZN eee Examples: IE 2¥BRAKG Kee XT Gf nari sare, Lo41 mul = mul t mul = 2 a sa"t 4 tAaeD lL +23 & +64 zh t 24*9 eae 44 ere ap ays A a BAe we a\e= Fen the on eis 3A. AISe UEESL zl> = [qnester, tlio e« j 4 eS ama > a ae ar aT Ble GA aos e trite , b+ 5] adci-2, [-:a,i-- —_____ inte —_ 4 aint OA aarti RA Sse ar TNT tixiles, t=3 petel-5 .f-95 ¥# Sa OTA. 44 (Gayene) wR Let te Sum=Sum+ Lei bod &. Sums Sumy tated BAG SSSI HASH age se Loop zyacTa 22 4 & a ne a@ aMAGr A Ty aia da gaye “BA (Loop) aay ¢loop Aiwa » Bam’ ; a. fact loop 2. while loop 3. dow. while. (oop +6lroeluce of Loop Nanny fort loop : asi x lenimafety Regal ction + Test cbnedition : heroes) staf Example: 4434 G4 94-0 +N - AMID Mar! Be (isa ir2en¢ Ceiea's Sum= Sum+et } While bas Inifial-eation 5 while (test condition) Stotement : Jnenament/ eerament ; 3 Example: 20+ 2R +2 ee EN ATG Se t=204 . ; while G>=N) Sum= sum+t izi-3i 4 do -.. While loop eer Ste Initialization 5 do £ sement ' Inerament/Deenemont ; while (test eondilion) ‘ Exomple: 5494134 AN t=G% do t sume Sum+e $ c=b+4; 3 while (i=); 4 gp-to loop “f Egr pth it ee tN st» initialization: sts, dumps bens statemsnt ; whe ot Tnonenord/ Deerement ; se yey iP (condi frén) Siete iPCiz=n) ? rr goto ome ; A+ 4 THAI eee +N Stata anu a oat ag A.F oe @ler? >. Algorithm @a (AAT t- Slep-o1: Slard Slep-or: Input Raut. Naa aI Az s step-03 1, Sum=o aay t=. BEAT Sdep-o4: LEN (AY D Yes: slep-§ A Tes No: Step-6 A are! step-of: Sumzsum4i age i=l4+3 Gouna step-06! Oufeut a sum araft Step-07: End rt 2. Flow- chor, “ag Ranger: le. @-Program aa Fag fort loop 4 include min( ) int N.i, sumo? seanf' (xd *, gn); for (i=1; cen; i= ah Sum = Sumi, a print Pd ‘, sum) i. t while loop # include main ( ) inf ri, sumzo § oar kak pin a 5 bot, 3 z thi a a‘): gum = Suma “Ge b+ as + . print r “o Sum): 5 ! do.....While loop # include Algorithm Ga FINA t- Step-ot : Staret ’ Step-02.: Input Renta N Ga a ARs Step-03: SUM=0 aay b= 100 SATAL | Skep-04: tan (RK Wr? Yes: step-of A Yo _ NO! Step-06 A- Ue step-06 | Sum= Sum4ixiwe Aa b=t-F step-06 : Oulput A sum ag aA Aaya) Step-0% + End Lt 2. Flow-chant aa QO be Sum20 , 6 =100 Fy ‘Sum = Sum-+ tele) tel-F @-Rogstam Coding - aa GOH CANAAN vn While loop do... While loop s js arrrnn* . df include ¢seio. > # include | uy ichde =qyi t=t- a PaWDOG” 3 do ; _- while (i> =n ) i= 1003 Sum = bum +. bi ; eon 4 . Sum >Sum+0% sumesum+e $ rein“ % *, Sum) s oy ne = print, 5 4 printPOrd, Sum)s| while (t>=n) § print AC zd , Som) ¢ d }

You might also like