Question Paper C Language

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Seat No.

: ________

Enrolment No.______________

GUJARAT TECHNOLOGICAL UNIVERSITY


DIPLOMA ENGINEERING SEMESTER I EXAMINATION SUMMER-2015

Subject Code:3310701
Subject Name: Computer Programming
Time:02:30 PM TO 05:00 PM

Date: 30 /05 /2015


Total Marks: 70

Instructions:
1.
2.
3.
4.
5.
6.

Attemptallquestions.
MakeSuitableassumptionswherevernecessary.
Figurestotherightindicatefullmarks.
Useofprogrammable&Communicationaidsarestrictlyprohibited.
UseofonlysimplecalculatorispermittedinMathematics.
Englishversionisauthentic.

Q.1

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Q.2

(a)

(a)
(b)

(b)
(c)

(c)
(d)

Answeranysevenoutoften.
Defineflowchartandalgorithm.
StateanyfouradvantagesofClanguage.
Distinguishbetweenconstantsandvariables.
Describescanf()statementinClanguage.
ListbitwiseoperatorsinClanguage.
Differentiatebetweenbreakandcontinuestatement.
WritesyntaxofforloopinClanguage.
DescribeternaryoperatorinClanguage.
Definearray.Showhowtodeclaresingledimensionalarray.
Stateanyfourcharacteristicsofanarray.

Drawandexplainsymbolsofflowchart.
OR
Writelimitationsofflowchart.
Drawflowcharttofindwhethergivennumberisoddoreven.
OR
Writeanalgorithmtocalculateareaofarectangle.
DrawandexplaingeneralstructureofCprograms.
OR
ExplainprimarydatatypesofClanguage.
Finderrorsinfollowings:
(1)Intx;(2)floatx=10;(3)longcharb;(4)#definePI=3.14

OR
(d) Statewhyfollowingareinvalidvariablenames:
(1)1total(2)finalresult(3)count$(4)goto

14

03
03
03
03
04
04
04

04

Q.3

(a)

(a)
(b)

(b)
(c)

(c)
(d)

(d)

Q.4

(a)

(a)
(b)

(b)
(c)

Q.5

ExplainTypeCastingconceptinClanguage.
OR
ExplainFormattedOutputconceptwithexample.
WriteaCprogramtofindareaofacircle.
OR
WriteaCprogramtointerchangetwointegernumbers.
ExplainRelationaloperatorswithexample.
OR
ExplainLogicaloperatorswithexample.
ExplainIfelseifLadderstatementwithexample.
OR
ExplainSwitchstatementwithexample.

03
03
03
03
04
04
04
04

Writedifferencebetweenwhileanddo..whileloop.
OR
Explaingotostatementwithexample.
Writeaprogramtofindmaximumoutofthreenumbers.
OR
Writeaprogramtofindfactorialofagivennumber.
Writeaprogramtoprintthesumofdigitsofagivennumber
(i.e.123=1+2+3=6)
(d) Writeaprogramtoprintfollowingseriesusingloop
13579.55

03

(a) Explainarrayinitializationconceptwithexample.
(b) Writeaprogramtoreadarrayoffiveintegernumbersandcalculatetheir
sumandaverage.
(c) Statehowtowrite,compileandexecuteCprogram.
(d) Ifb=10andc=5thenwhatwillbethevaluesofa,bandcaftertheexecution
offollowingstatement:
a=b++c*2

04
04

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

03
04
04
04
03

03
03

Flowchartalgorithm .

Clanguage.

Constantsvariable.

Clanguagescanf()statement

Clanguagebitwiseoperator.

Breakcontinuestatement .

Clanguageforloop.

Clanguageternaryoperator.

Array .Singledimensionalarray

Array.

Flowchart .

Flowchart.

flowchart.

algorithm.

Cprogram

Clanguageprimarydatatypes.

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

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

ClanguageTypeCasting .

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,
.

b=10c=5statement

c :
a=b++c*2

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

a,b

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy