0% found this document useful (0 votes)
40 views16 pages

C Language Assignment

Uploaded by

ADITI NEGI
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)
40 views16 pages

C Language Assignment

Uploaded by

ADITI NEGI
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/ 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 \P4. 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 ShapeGenenat 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 ? U5 nedwin 05 3 outbut— O=5,b=9 a& bal olb=\3 a*%b= 2 was -6 b int main) Dong tnt decMam , sem 910; Tne Jel, t,4emb 5 han hixadecNumnlloo]; pyunkfl "Enter any deuimal number +o Convert seont ("éa" § decNum); ft to hexadecimal Mm; ")3 uae decNurns whihe (qyu0!=0) i fem = yuo % 165 44 (temp 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 exbroken 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; 3Sus 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 Hiindode Hindle 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, \DContinue 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 # Includes Cowo. h> Void mainl ) ' nt J2V Chasen 5 Count; ai prints (Xan i)5 v/ dts 3h Li

You might also like