Friday, December 19, 2008

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec. 2006

MCA (Revised)
Term-End Examination
December, 2006
MCS-011 : PROBLEM SOLVING AND PROGRAMMING

l. (a) Write an algorithm and draw a corresponding flow chart to print the sum of all integers starting from 2 to the given positive integer x where x > 2.

(b) Write a recursive program in 'C' to find the L.C.M. (Least Common Multiple) of two given numbers.

(c) Write a program in 'C' to print the following
format :
C
C C C
C C C C C
C C C C C C C
C C C C C C C C C

(d) Write a non-recursive procedure in 'C' for calculating
power of a number 'm' raised by another number 'n'.

2.(a)Design an algorithm and draw corresponding flow chart to print the value of the number in words when the number entered is in the range of 1 to 299.

(b)Using pointers, write a program in 'C' to count the
occurrence of each character in a given string.

3. (a) Write a program in 'C' that accepts 10 words of varying length and arranges the words in the descending order of word length. [use array].

(b)Write a program in 'C' for the multiplication of two matrices.

4.(a)
Write a program in 'C'to check whether a given string is palindrome. (use Pointers).

(b)Write a program in 'C'for the addition of two polynomials.use Arrays and Structure

5.(a)Write a program in 'C' that accepts two files as input and creates a new file whose contents include the contents of two input files.

(b) Consider a data file containing some records of type STUDENT :

Struct STUDENT
{
char Name[20];
int Roll_No;
float marks;
} ;

(i) Write a function, which takes file name as an argument and returns the number of records in that file.

(ii) Write a function, which takes two arguments :
filename and Roll_No(s) and deletes the corresponding records with these Roll_Nos from that file.

No comments:

Post a Comment