Question Paper C Language

Embed Size (px)

Citation preview

  • 7/24/2019 Question Paper C Language

    1/5

    Seat No.: ________ Enrolment No.______________

    GUJARAT TECHNOLOGICAL UNIVERSITYDIPLOMA ENGINEERING SEMESTER I EXAMINATION SUMMER-2015

    Subject Code:3310701 Date: 30 /05 /2015

    Subject Name: Computer Programming

    Time:02:30 PM TO 05:00 PM Total Marks: 70Instructions:

    1.

    Attempt

    all

    questions.

    2.

    Make

    Suitable

    assumptions

    wherever

    necessary.

    3.

    Figures

    to

    the

    right

    indicate

    full

    marks.

    4.

    Use

    of

    programmable

    &

    Communication

    aids

    are

    strictly

    prohibited.

    5.

    Use

    of

    only

    simple

    calculator

    is

    permitted

    in

    Mathematics.

    6.

    English

    version

    is

    authentic.

    Q.1 Answeranysevenoutoften. 14

    1. Defineflowchartandalgorithm.

    2. StateanyfouradvantagesofClanguage.

    3. Distinguishbetweenconstantsandvariables.

    4. Describescanf()statementinClanguage.

    5. ListbitwiseoperatorsinClanguage.

    6. Differentiatebetweenbreakandcontinuestatement.

    7. WritesyntaxofforloopinClanguage.

    8. DescribeternaryoperatorinClanguage.

    9. Definearray.Showhowtodeclaresingledimensionalarray.

    10. Stateanyfourcharacteristicsofanarray.

    Q.2 (a) Drawandexplainsymbolsofflowchart. 03

    OR

    (a) Writelimitationsofflowchart. 03

    (b) Drawflowcharttofindwhethergivennumberisoddoreven. 03

    OR

    (b) Writeanalgorithmtocalculateareaofarectangle. 03

    (c) DrawandexplaingeneralstructureofCprograms. 04

    OR

    (c) ExplainprimarydatatypesofClanguage. 04

    (d) Finderrorsinfollowings:

    (1)Intx;(2)floatx=10;(3)longcharb;(4)#definePI=3.14

    04

    OR

    (d) Statewhyfollowingareinvalidvariablenames:

    (1)1total

    (2)

    final

    result

    (3)

    count$

    (4)

    goto

    04

  • 7/24/2019 Question Paper C Language

    2/5

    Q.3 (a) ExplainTypeCastingconceptinClanguage. 03

    OR

    (a) ExplainFormattedOutputconceptwithexample. 03

    (b) WriteaCprogramtofindareaofacircle. 03

    OR (b) WriteaCprogramtointerchangetwointegernumbers. 03

    (c) ExplainRelationaloperatorswithexample. 04

    OR

    (c) ExplainLogicaloperatorswithexample. 04

    (d) ExplainIelseifLadderstatementwithexample. 04

    OR

    (d) ExplainSwitchstatementwithexample. 04

    Q.4 (a) Writedifferencebetweenwhileanddo..whileloop. 03

    OR

    (a) Explaingotostatementwithexample. 03

    (b) Writeaprogramtofindmaximumoutofthreenumbers. 04

    OR

    (b) Writeaprogramtofindfactorialofagivennumber. 04

    (c) Writeaprogramtoprintthesumofdigitsofagivennumber

    (i.e.123=1+2+3=6)

    04

    (d) Writeaprogramtoprintfollowingseriesusingloop

    1

    3

    5

    7

    9

    .55

    03

    Q.5 (a) Explainarrayinitializationconceptwithexample. 04

    (b) Writeaprogramtoreadarrayoffiveintegernumbersandcalculatetheir

    sumandaverage.

    04

    (c) Statehowtowrite,compileandexecuteCprogram. 03

    (d) Ifb=10andc=5thenwhatwillbethevaluesofa,bandcaftertheexecution

    offollowingstatement:

    a=b++ c*2

    03

    ************

  • 7/24/2019 Question Paper C Language

    3/5

    . .

    . Flowchartalgorithm .

    . Clanguage .

    . Constantsvariable .

    . Clanguagescanf()statement.

    . Clanguage bitwiseoperator .

    . Breakcontinuestatement .

    . Clanguageforloop .

    . Clanguageternaryoperator.

    . Array .Singledimensionalarray

    .

    Array .

    . Flowchart .

    Flowchart .

    flowchart.

    algorithm.

    Cprogram .

    Clanguage primarydatatypes .

    :

    (1)Intx;(2)floatx=10;(3)longcharb;(4)#definePI=3.14

    variablenames :

    (1)1total (2)finalresult (3)count$(4)goto

  • 7/24/2019 Question Paper C Language

    4/5

    . Clanguage TypeCasting .

    FormattedOutput .

    Cprogram.

    integernumbers Cprogram.

    Relationaloperators .

    Logicaloperators .

    IfelseifLadderstatement .

    Switchstatement .

    . Whiledo..while .

    Gotostatement . program.

    factorial program.

    program.

    (123=1+2+3=6)

    Loop program .13579.55

    . Arrayinitialization

    integernumbers

    program.

    Cprogram ,

    .

  • 7/24/2019 Question Paper C Language

    5/5

    b=10c=5 statement a,b

    c :

    a=b++ c*2

    ************