Tuesday 27 November 2012

Calicut University B.Tech Electronics and Communications Engineering Computer programming in c Question paper

Are You Looking old question papers of B.tech ? find here old question paper from calicut university B.Tech Electronics and Communications Engineering Computer programming in c 2008

THIRD SEMESTER B.TECH. (ENGINEERING) DEGREE
EXAMINATION, DECEMBER 2008
CR 04 302-COMPUTER PROGRAMMING IN C
(Common to all except CS, IT, PT)
[2004 Admissions]
Time: Three Hours Maximum: 100 Marks
I.
(a)
What is an algorithm? What are the characteristics necessary for a sequence of instructions
to qualifY as an algorithm ?
(b)
How does a flowchart help a programmer in program development?
(c)
List the relational operators used in C and explain their precedence relationship_
(d)
What is an escape sequence? Explain.
. (e)
State the uses of go to and label statements in C.
(f)
Explain four loop with an example.
(g)
Explain the concept ofpointers and arrays with. an exaI!lple!
(h)
Explain array ofstructures with an example.
(8 x 5 =40 marks)
II.
(a)
What is a system? Why do we refer to a computer as a system? (5 marks)
(b)
Draw flowcharts for the two different structures used for iteration logic. (5 marks)
(c)
What is a generalized algorithm? Why should programs be general in nature? (5 marks)
Or
(a)
What characteristics are desirable for a good computer language? (5 marks)
(b)
What is a self-documenting language? Illustrate with an example. (5 marks)
(c)
Name the three different categories of computer languages. (5 marks)
III.
(a)
Ifyou have access to a computer system with the C compiler, find out the details of the operating
system and special features ofthe compiler.
(5 marks)
(b)
Find errors, ifany, in the following assignment statements and rectify them:
(i) x = y = z = 0.5, 2.0, -5.75 ;
(ii) m =++ a '" 5 ;


(iii) y = sqrt (100) ;
(iv)
p*=xIy
(v)
8 =15;
(vi) Cl = b++ -C *2. (10 marks)
Or
(a)
(i) State the use ofsize ofoperator and how does it work.
(ii) State the use ofmodulers operator and how does it work. (8 marks)
(b)
List the special operators used in C. Explain with examples. (7 marks)
IV. (a) Write a program to generate armstrong number. (5 marks)
(b)
Explain do-while loop with an example. (5 marks)
(c)
Compare and contrast for and do-while loops. (5 marks)
Or
(a)
In what ways does a switch statement differ from an it statement? (5 marks)
(b)
Find errors, if any, in each of the following looping segments. Assume that all the variables have been declared and assigned values :
(i) While (count! = 10) ;
Count = 1;
Sum=sum+x;
Count = count + 1 ;
(ii) name =0 ;
do (name = name + 1 ;
print {(UMy name is John\nU);}
while (name = 1)
(iii) do;
total = total + value;
scan {(liCk f', & value) ;
while (value? =999) ;



(iv) for(X =1, X > 10 ; X =X + 1)
-}
(v)
m = 1
n = 0;
for ( ; m + n < 19 ; ++ n) ;
print f("Hello\n");
m=m+ 10;
(vi)
for(p = 10; p> 0 ;)
P=P-l;
printf("% f', P) ;
(10 marks)
v.
(a)
Assume that the arrays A and B are declared as follows:
int A[5] [4] ;
float B [4] ;
find the errors (if any) in the following program segments.
(i)
for (i = 1 ; i < =5 ; i++)
for (j =1 ; j < = 4 ;j++)
A[i] 111 =0 ;
(ii)
for (i = 1 ; i < 4 ; i++)
Scan f ("% t, B [iD ;
(iii)
for (i =0 ; i < =4 ; i++)
B [i] = B[iJ + i ;
(vi)
for (i =4 ; i > = 0, i --)
for (j =0 ;j < 4 ;j++)
A [iJ 111 =B 111 + 1.0 ;
(8 marks)
(b)
Describe the limitations ofusing getchar and scanffunctions for reading strings. (7 marks)
Or
Turnover
Mets Digital library
Mets Digital library
!
4
D 51466
(a) (b)
Explain the meaning and purpose of the following:(i) Template. (ii) Tag. (iii) Size of. (iv) Struet. Write a program to copy the contents of one file into another.
(8 marks) (7 marks) [4 x 15 =60 marks]

No comments:

Post a Comment