B.E./B.Tech: Degree Examination - May/ June 2014 Second Semester Computer Science and Engineering Cs 6202 - Programming and Data Structures - 1
B.E./B.Tech: Degree Examination - May/ June 2014 Second Semester Computer Science and Engineering Cs 6202 - Programming and Data Structures - 1
COM
Second Semester
(Regulation 2013)
1. With the help of the print of function show how C handles functions with
variable number of arguments.
2. Define macro with an example.
3. Give applications in which unions rather than structures can be used.
4. Will be following declaration work. Justify your answer.
{
int rollno = 12;
float marks [] = {55,60,56};
char gender;
5. Should arrays or linked lists be used for the following types of applications
Justify your answer.
(a) Many search operations in sorted list
(b) Many search operations in unsorted list
STUDENTSFOCUS.COM
PART B – (5 x 16 = 80 marks)
11. (a ) (i) Write a C program to find the unique elements in an array using a
function “ Unique”. The function takes the array as a parameter
prints the unique elements.
(ii) Write a C program to print the Fibonacci numbers.
Or
12. (a) (i) Write a C program to read the contents of a file “in.txt” from last
to first and write the contents to “ out. Txt”. (8)
(ii) Write the function prototype and explain how files are manipulated
in C. (8)
Or
(b) (i) Create a structure to store a complex number and write function
(for addition) that handle this new structure. (8)
(ii) Write a program to perform the following operations for the
customers of a bank using the concept of structures. (8)
(1) Input the customer details like name, account number and
balance.
STUDENTSFOCUS.COM
15. (a) Write short notes on hashing and the various collision resolution
techniques.
Or
(b) Write an algorithm to sort „n‟ number using quick sort. Show how the
following numbers are sorted using quick sort : 45,28,90,1, 46,39,33,87.
………………….