D 13796 (Pages: 2) Name .....................................
Reg. No ................................. .
�ST SEMESTER B.Sc. DEGREE EXAMINATION, NOVEMBER 2016
(CUCBCSS-UG)
Core Course-Computer Science
BCS 1B 01-PROBLEM SOLVING USING C
Time : Three Hours Maximum : 80 Marks
I. Answer the following :
1 Define algorithm.
2 What is the output of the following code ?
# include <studio.h>
int main()
{
int i=l;
printft:"%d o/od %d", ++i, i++, ++i);
return (O);
}
3 Differentiate between Keyword and Identifier.
4 Define symbolic constant.
5 What is the associativity of conditional operator ?
6 Name the command that is used to skip the rest of a loop and carry on from the top of the loop
again.
7 Define a pointer variable.
8 What is _printed when this program is executed ?
int f(int x) {
if (x<=4)
return x;
return f{--x);
}
void main O {
printf ("%din", f(7));
} }
9 Define Union.
10 Define macros.
(10 x 1 = 10 marks)
Turn over
2 D 13796
II. Answer all questions :
11 What is bottom up approach in C ?
12 What is the general form of conditional operator ? Give an example.
13 Write a program to read three numbers and print them in ascending order.
14 Distinguish between break and continue statement.
15 Explain the use of* operator.
(5 x 2 = 10.marks)
III. Answer any five questions :
16 Explain the basic structure of C program.
17 Write a program to find the product of two matrices.
18 Differentiate with suitable examples, actual and formal arguments in C function.
19 Write a program to count the number of boys whose weight is less than 50 kg. and height is
greater than 170 cm. from a list of n boys using for loop.
20 Write any four string handling functions and explain with example.
21 What are pointers ? Explain how to perform arithmetic operations on pointers.
22 What are files ? Explain how files are opened.
23 Explain dynamic memory allocation.
(5 x 4 = 20 marks)
IV. Answer any five questions :
24 Explain different looping structures available in C with examples.
25 Write short ntoes on:
(a) Global variables.
(b) Structures in C.
(c) Multidimensional arrays.
26 Write a program to find the roots of a quadratic equation.
27 Define a structure called cricket that will describe the following information:
Player name, team name, batting average. Using cricket declare an array player with
50 elements and write a program to read the information about all the 50 players and
print a team-wise list containing names of players with their batting average.
28 (a) Write a program to merge two sorted array in to a single sorted array in ascending order.
(b) Write a function to remove duplicates from an ordered array.
29 Write a recursive function to generate and print first n Fibonacci numbers.
30 What are preprocessor directives in C ? Explain various forms of macro substitution.
31 Two files DATAl and DATA2 contain sorted list of integers. Write a program to produce a
third file DATA which holds a single sorted, merged list of these two lists.
(5 x 8 = 40 marks)