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

G 3966 (Pages : 2) No

Name ..
FIRST SEMESTER MCA DEGREE EXAMINATION, MAY 2004
MCA 105 PROBLEM SOLVING AND COMPUTER PROGRAMMING IN C
Time : Three Hours Maximum : 75 marks
Section A
Answer any five questions. All questions carry equal marks.
1. (a) Explain the various data types in C language with examples. (7 marks)
(b) Write a C program to generate n Fibonacci numbers. (8 marks)
2. (a) Describe Top down and bottom up approaches. (7 marks)
(b) Write a C program to compute the series x/1! x
3
/3! + x
5
/5! x
7
/7! + (8 marks)
3. (a) Write a C program to search a particular number using binary search algorithm. (8 marks)
(b) Explain time and space complexity. (7 marks)
4. (a) Explain recursion with an example. (7 marks)
(b) Write a C program that accepts an MXN matrix and print the square of each element. Use separate
functions for reading and printing. (8 marks)
5. (a) Explain the different loop control statements. (7 marks)
(b) Write a C program using pointers to find the biggest and lowest values entered in an array.
(8 marks)
6. (a) Explain the different methods for passing arguments to functions. (7 marks)
(b) A student record consists of Register No. Name and Marks in 3 subjects. Write a program in C
using structure to print N student details in the following format. Use separate function for
printing. (8 marks)
Register No. : Name Mark 1 Mark 2 Mark 3 Total Mark
7. (a) Give short notes on
(i) union.
(ii) C preprocessor.
(iii) Macros.
(iv) Bitwise operations. (8 marks)
(b) Write a C program to check whether a given matrix is upper triangular or lower triangular.
(7 marks)
Turn over
2 G 3966
8. (a) Consider the sequence of natural numbers.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10..
Removing every second number products the sequence
1, 3, 5, 7, 9, 11, 13, 15.
Removing every third number from the above produces the sequence.
1, 3, 7, 9, 13..
This process continues indefinitely by removing the fourth, fifth. & so on. After a fixed number of
steps, certain natural numbers remain indefinitely. These are known as lucky numbers. Write a program
in C to generate and print lucky numbers less than a given natural no.N where N 50.
[e.g.: Lucky numbers less than 10 are 1, 3, 7] (15 marks)

You might also like