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

C Language Assignment

Uploaded by

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

C Language Assignment

Uploaded by

ADITI NEGI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 16
Assignmerct-) D whok one the Various Flowchart cyibolla? Explor With dolguem. Diow aabloachaad 1e, tnbus Howe monks, Hen Compute and cuAsbsoy He Percentage? Ang: Flowthart Symbols Can Ahow Ye blow ond Logic \pekween {otas and Concebts. ane Used tn walling 1 Some in fount and Some In advertising. Bosic Elowthart S symbols: \. The oval % fhe oval ot Pill Shope vreprusent the Stent lend, aes The Oval ot PU Ahape the_R Shape s- the Rectorgle Shabe the Rectangle Shope (4 Neprecsent & Process. (cs & engl ¢ Ahape - forall - A. fan elogtam Shape ‘- farallelossam Ahabe rep the Prput/outbt 4 Hy ‘uber ae, fi anal elo an Noa \P 4. Diamand Shape'- Diamond Ahope ne pnesenks a decision. fo / Diamond Shope SF Ayrow shobes- Agnew Shebe supnesents a plow ob Hae Sequence. aoe tase Ane WwW Shape Genenat Pnocedure %-().wWoute a Valid od gosuithm, ©. Use appropriate Symbols bet each Step ob Your al gosuthm, : @ Remember, every Aowchant betgs with a Start Sends with a Stop, O Adtee Completing the Visi, eran Finally Construction 6b hflowehost the above Steps, check & test ft with Some Qe , gourr Fowchark will be cee 82 What one the bitwise operatons? Explain how thwise openotos one difberrt rom othen oberoton? Explain witha Preben example to ue trade, Hne weirting ob oll We bitwise apencdons? Ans Bitwise gperotons 2 In Ci the folowing 6 op ehaikes on bitwise openatans. A» Qlbthwise AND) Tn Coe cH fakes two number ob opiands and does AVD en Quay bit 0b two numben then sesult of AMD rsd only 4 both tts oned. oA J Cbftue oR) & Ty Cm Ctt taker Lwo number oA opetonds and does oR & every bit 66 +wo number, the nesult ob RA 4 Oh any sb the two bits fad, 3. AUothwise XO) Tn cot cH takes tug numbers a ie operands and cloes Yor en every bit ob two number. the mesilt a4 vor Ps 4 3 Phe wo bits ore olifferenk, We << Chebt Ahi) *- Lh cog crt 4, o humba roo. ANG she ile aide des ee § ol vi c ? U5 nedwin 05 3 outbut— O=5,b=9 a& bal olb=\3 a*%b= 2 was -6 b < rat main () t bscivath ("xd \n" ole); point (“Zo\n", ole); punkh C1 o\n", 8); net wn 05 5 wtput ;- outbul | Jo Jo F G4 s- hak ane teb- down and bottam— ob dean a Sutin in Programming 2 4 Pinas. the Tof-Down Approach’- tn the top - down abbsieac = i a Combhex ol g.osuith m a bnoken down into Smaller f sogiments ellen Krows ot ‘modules’. These madules ae then twwh ex broken down rnto Smaller Frigg manks Unk they fan Do Lon, en be. bora, ments, Advantages*-+farh module of Code ts tobe Headed Separately. , Bovating a Problem down fnto Smaller Chunks makes H box %eouion to Understand, Aolve anol manage. “Teatig and dlebugging ane efticient and Casien, Drawbacks:- *Shectication fends to change Over Aime eae eae th. a top-down oppsioach, al decision Mode from the beigtnning 66 the Prroset olepend dined, t Prd inectt 7 : dn namic Poeogramrntng We top-down abbnoach [A Slow as Compared to” the bottom - uP abpnoach, of it Prvolves necursion, Battom -UP AppSioach = Contrary to the tob- down obboroach ; bottom - up Porog4a mening focus ex on od 2 algosuithn by beginning at the Very basic Level ond building UP os PF jou Adlentase:- + Tit Conditone ane easier fo Coeale, *obsewvalton of test nests % eouser, * Contains Less grtedundanc due to the Presence 06 He clata encapsulation and olata- hasreling, . Res obrLity of the Cocle. Daubacks*- + Tn the Bottom - up abbroach, we Salve i all Sob- Problima, which sreeytures crdlolitid. nal Colewations, "In the Bottom— uP Opp roach, Something Ph Pack: Cult fo jolente4y the ovenal/ Functionality ot the Systm tn He Pnebeat Stages. he é Tat - down Abbsoach Botlorn UP Abperoach gsr what ane the Kewonds inc? List the nules fox naming a Vasiable in c? Ans’ Key woods ahe wWohds thet have spewed ame = 1% Complies. In trandtahon Phos Band & an jolenkifier Cont have the Same Apelliig and Cases 04 C Keyword. Ex Codes $pinuuding fot man) t St bet, C2185 char at='T 5 brinth (hora en Value 2 %cln", ot )3 lopdtbl’ Titeg et Vedue 2 ped\t xd\n"6,0)% netusn 0; 3 Sus bus t- Chanacten Value % 7 Integer Value. It 18 Rules * “1A Vaniable Con have alphabets, cligits ond Under score. Variable name Con Start with ty atbhebet : ae UnderAcore only. Jt Conle Start with a digit. tee "5 allowed within the Vasuabse aw Vesiable name must not be ony gusenved word 6 Keyword. Bee Explain the difheunt Kinds ot Loos averilabs inc with exambles? Anse Loobing Statement In © execule, the Seanad SF op Chakemenks many Limes unt te Condi ton \becomes fake. A had en c Comat, two . | a bedy ao boob and Cantyiol Stotement. jwhitle Loob fn C1 A while Locp Px the most ee forward Looping Structures while Joop Cynon we Propramnmirg Pohgoont ty os follows? Sywkax t- whihe hs Condition) i Soke anks 5 i oO Exe FoLowtiy Program fllustnates while Loop Pn c Progeomming example. Hnclude < Stevo h> Hiindode< Cove h7 Ink main ) : Iyd nume=l; while (num Hindle < con h? futmen ) Tat num =l5 do Lu ("% d\n", 28 pum) num+t5 3 while (num <= 195 utum (2) 3 Fon Loop t- A Fox Loch 2s a mone ebbicent loch Atwutwe fn tc! e & inc’ Prostomming, The dentral Structure 64 fet Loob S ira? A Lollows? Ap Spar a Ee S 4 Syntay? for Crnttial Value; Conditions incuemental: dlecrtmentotion) nee Statements + Ex: Following Peeytom Mustnates the bor Joop In & Px opto mmung 0 xa mpl: # include < Stolio.h> int mon O) lat numbers For (number n-1} number 1-104 number +4) [- Jo numbers i prcintd ("soal|n", number); 5 Juturn os 5 o ut | PD HO BR gy po EL ° 84+ Eyploin goto, brok and Coritinue Stote ments Pr Cc. WAP to Pyuint Table eb a Numbex Using Joto Statemunts. Ses fut Geka In ¢ Peyton, baat i Stofemunt fs Used With Condit -onal 3b Stotemunts, \D Continue Statement s- Jt 1% Sometimes desinabhe a to Skip Some Statements Paste Sie: deeki Le Such: Casa» .Covtioue . Stademehb: 3A Used. (roto Statement t- Inc Pac grammerg , goto State mew ts Ps Used bog cul tering the vesgumet sevens vf Poo yeam execution by thamfomrg Control te Some athen bart of the Psosiom. Ex* Progtam- Hfnclude< Stolia. h> # Includes Cowo. h> Void mainl ) ' nt J2V Chasen 5 Count; ai prints (Xan i)5 v/ dts 3h Li<= 1s) t goto Count § getch C 5 3 Qustbut BODHLAE)-Ped ys HAF ° 89- who au the Vaw'ovs Contnal Statement fi ae Lomguage? pnate Control Statements s In ¢ Longuages, the ee Control of the Program Plows Asem a fiven Paptruction to ayothe,. tuts +ybe 06 Contned plow that occur bom any given Command to Gnothes, Tyb 1b. 94 Statement This tybe 04 Satement wowed ee 5 Croble o Programmer to Choose aus Indtruchon Sets on the basis 66 dre Available Conditions, © Simbse Ole o¢ Mull else * Else 3b Sladder ° Wedted 3f * 3b elie 2: The Suttch Statements %- fhe C Jong uage offers It : UAHA With aq Seleton Stoteme “WA JW Various ways fn Cue a Program become Abit +o read with on Increased number ob Cocition. 3: Condihonal operates Statemonts- The ¢ Lan vage alto Comes whth Openeto.n ° Operato.n, 04 Whot Ps tybe Convemion in c? a Very Unvsual ot Its PHogtammens - the Conditional Amis Tybe Convenions Tybe Convenion tne 4 tha Process ob Converhing ome data tybe to another, ee two types ef Conversion. J Lmbbot Type Conversion’- Avo Known ot ‘autome -te' type Conversion A. Done by the Campy: i a : ext t Compiler on its own, trout eine trugge fom the Usch. ae 8. ee types 06 the Vasuable are UPyrade dota type of the Vanaible with He Langot dota 4 ype. bool Short ink (Cit) (CC dovbe Cory dovble - eeu Tybe Conversion: This Erocess 14 also ' ; Called + ; and Pt is User- defined. Here be Cashing Ha result 4 woke 66 a. Paxticolan ci tao a Expliut tybe ) Hugher L Conversion Dota ie tybe Oloe- Give any 2 HHorence between while ~~ Shatemmt and olo-~ while Statenunt? Bngs- white Dowwile p IPL Checks the Thebeob wri executes Condi Hon finak the Statement ok and Hun exc ules Jawt ance, tron He Chotements Condition fA chee Kedl. Bit th on eukoiy It f an eutt Cortno- Controlled Noob. eal Qoob. Olle Gfves ans +uo dikbeence between Comb ers § fywhedbnetens? Ana Compiler 1. A Combpater: r+ PA not Alex?ble. Th Px mone fh PA Sess epbicie ehbicienk. Trenton PE fs Mewible,

You might also like