411 REFERENCE · Wikibooks
IGNOU Question Paper Solutions/MCA/Semester 1/MCS-011 Problem Solving and Programming/December 2008
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
MCA (Revised)
Term-End Examination
December 2008
MCS-011: PROBLEM SOLVING AND PROGRAMMING
Time : 3 hourse
Maximum Marks : 100
Note: Question number 1 is compulsory. Answer any three questions from the rest.
1.(a) Design an algorithm, draw a corresponding flowchart and then write a program in C to convert a given string to lower case. [10 marks]
1.(b) Write an algorithm and program in C to generate filbonacci series. Use recursion. [10 marks]
1.(c)Draw a flowchart and write a program in C to calculate the number of vowels in a given string. [10 marks]
1.(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. [10 marks]
2.(a)Write the usage of the following (with an example of each): [5 marks]
(i) #define
(ii) enum
2(b)Write a macro for the following: [7 marks]
(i) To find the smallest number among 3 given numbers.
(ii) To find the factorial of a given number
2(c) What are the differences between structure and union ? Give one illustrative example of usage of the union. [8 marks]
3(a) Write a program in C, using structures to generate a report for employees which displays the total salary, designation, department,etc. Assumptions can be made wherever necessary. [8 marks]
3(b) Write a program to read formatted data from the file. [6 marks]
3(c)Give a brief note on null pointer assignment. Write a program in 'C' to illustrate this concept.
[6 marks]
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.
[8 marks]
4(b)Give differences between :
(i) Sequential and Random Access files
(ii) Global variable and Local variable
4(c) Write a program and flowchart to display the following pattern : [6 marks]
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
5 *5(a) Write a program in C to find the difference between two matrices of size (3 x 3). [5 marks]
5 (b) Write a program in C to sort a given list of numbers using bubble sort. Draw corresponding flowchart also. [7 marks]
5 (c)Explain meaning of following prototypes and mention return data type of each of them : [8 marks]
(i) int (*f) (char*);
(ii) int *f (char*);
(iii) doule f (int a, int b, char c);
(iv) unsigned f();