Friday, December 19, 2008

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec-2007

MCA (Revised)
Term-End Examination
December, 20O7
MCS-011 : PROBLEM SOLVING AND PROGRAMMING
Time : 3 hours Maximum Marks : 700

(i) Question number 1 is compulsory'
(ii) Attempt any three questions from the rest.

1. (a) Design an algorithm, draw a corresponding flow chart and write a 'C' program for Binary Search, to search a given number among the list of numbers.

(b) Write the syntax for the declaration of a function.also discuss the parameter passing method with an example program.

(c)Write a recursive function in 'C' that computes the factorial of a given integer

(d)List and explain the precedence of Arithmetic, Logical and Relational operators in 'C'.


2.(a)Write an algorithm and draw flowchart to find whether a given string s1 is substring of another string s2.

(b)Write a program in 'C' language which accepts the enrollment number of a student as input and prints the name of that student. The program should initially store information about the (name,enrollment number) pairs of students in the form of
a matrix.

3.(a)Write a program in 'C' language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers.

(b)Explain any five functions of library.

4(a)Write a program in 'C'that accepts a sentence 's'and a word 'w'as input. Now, the program should print the starting position of right-most occurr ence of 'w'in 's'.

(b)Write a program in 'C' language that accepts the name of a file as input and prints those lines of the file which have the word 'this'.

5. (a)Write a program in 'C'language to convert decimal number into binary number.

(b) Write a program in 'C'language to add two matrices.

No comments:

Post a Comment