Friday, December 19, 2008

MCS-011: PROBLEM SOLVING AND PROGRAMMING June-2008

MCA (Revised)
Term-End Examination June. 2OO8
MCS-011: PROBLEM SOLVING AND PROGRAMMING
Time : 3 hours Maximum Marks : 1OO

1. (a) Design an algorithm, draw a corresponding flowchart and then write a program in C to convert a given string to lower case.

(b) Write an algorithm and program in C to generate fibonacci series. Use recursion.

(c) Draw a flowchart and write a program in C to calculate the number of vowels in a given string.
.
(d) What do you mean by 'array of pointers' ? Write a program in C to calculate the difference of the corresponding elements of two arrays of integers of same size.

2.(a)Write the usage of the following (with an example of each):
(i) *define
(ii) enum

(b)Write a macro for the following :
(i) to find the smallest number among 3 given numbers.
(ii) to find the factorial of a given number N.

(c)What are the difference between structure and union ? Give one illustrative example of usage o{ the union.

3.(a) Write a program in C, using structures to generate a report for employees which displays the total salary,designation, department, address etc. Assumptions can be made wherever necessary.

(b)Write a program to read formatted data from the file.

(c)Give a brief note on null pointer assignment. Write a program in 'C' to illustrate this concept.

4.(a) Write a program which reads a file and counts the number of lines and words in the file, assuming that a line can contain at most 80 characters.

(b) Give differences between:

(i) Sequential and Random Access files
(ii) Global variable and Local variable

(c) Write a program and flowchart to display the
following patten:
1
2 3
4 5 6
7 8 9 1 0
11 12 13 14 15
16 17 18 19 20 2l

5,(a) Write a program in C to find the difference between two matrices of size(3x3).

(b)Write a program in C to sort a given list of numbers
using bubble sort. Draw corresponding flowchart.


(c) Explain meaning of following prototypes and
mention return data type of each of-them :
(i) int (*f) (char*);
(ii) int *f (char*);
{iii) double f (int a, int b, char c);
(iv) unsigned f( );

No comments:

Post a Comment