Mcs-011@ MCA (Revised) Term-End Examination June, 2OO7
MCS-01 1@ : PROBLEM SOLVINGAND PROGRAMMING Maximum Marks : 700
Time : 3 hours
(Weishtage 75W Note :
Quesfion number 1 is compulsory Attempt any three questionsfrom the rest.
(a)
Design an algorithm, draw a correspondingflowchart and write a program in C, to find whether a given
1.
number is a palindromeor not.
10
(b)
Write an algorithm and a program in C to calculate 10 the factorial of a given number using recursion.
(c)
Write a program to generate the pattern given 10 below :
1 2 4 7
MCS-O11o
3 5
8
6 9 1 0
P.T.O.
2.
3.
(d)
When can two matricesof order a x b and c x d be subtracted ? Also write a program to find the differenceof two such matrices. 10
(a)
Write a macro to find out whether the given characteris uppercaseor not.
7
(b)
Write a program to read formatted data from file.
7
(c)
Explain the concept of a pointer to a pointer using an example.
6
Draw a flowchart and write a menu-drivenprogram in C to perform the following :
7
(a)
(i)
Calculatesquareof a number if choice is 1.
(ii)
Calculatecube of a number if choice is 2
(iii) Otherwiseprint the number as it is. (b)
Write the usageof the following with an example of 3x2:6 (il
enum
(ii)
typedef
(iii) struct (c)
Write a program in C, using structuresto generatea progressreport for studentswhich displaysthe total marks, average , percentage and corresponding division. Assumptions can be made whe rever necessary.
M C S -1 0o 1
7
4.
(a)
Explain the use of gets, puts, strcmp and strrev functionswith the help of examples.
B
6 (c,:1ff'.r::*:":n:":ffffi,ff,
(b)
Write a function in C to swap the values of two
with an example for each : (i)
Goto
(ii)
Break
6
(iii) Continue
in u' (a) I;::',l,T":''#"il:;,::;:::',',#;:ment 1 0 (b)
Write a loop that calculatesthe sum of the series :
10
1 + 4 + 7 + 1 0 + 1 3 + . . . Write the loop in 3 different waYs : (i)
using while loop
(ii)
using do-while loop
(iii) using for loop Also explain the algorithm for the above.
1@ MCS-01
3
3,000
!