No.
of Printed Pages : 3 MCS-011
MCA (Revised)
Term-End Examination
June, 2011
MCS-011 : PROBLEM SOLVING AND
PROGRAMMING
Time : 3 hours Maximum Marks : 100
(Weightage 75%)
Note : Question number 1 is compulsory. Answer any three
questions from the rest.
1. (a) What is an algorithm ? Explain basic 5
features of an algorithm.
(b) Write a C program to check whether a 10
given string is a palindrome or not.
(c) Consider the following program segment in 6
programming language C :
sum = 0;
for(i=1; i <10; i++)
sum + = i;
Write an equivalent program segment using
(i) do - while
(ii) while
MCS-011 1 P.T.O.
(d) What is a syntax - error ? Give an example
of syntax error in a C - program.
(e) Explain different arithmetical and logical 10
operators available in C, with the help of
examples.
(f) Explain the use of malloc function in 5
C programming.
2. (a) What is an array ? Write a C program to 10
add two matrices of 3 x 3 using arrays.
(b) What is the scope of a variable ? Explain 10
difference between global and local variable
with example program.
3. (a) What is a string ? Write a function in C for 10
string concatenation. Without the use of
inbuilt string function.
(b) What is a macro ? Explain how a macro is 10
defined in C. Also explain major differences
between a macro and a function. Explain a
situation when macro should be prefered
over function with an example.
MCS-011 2
4. (a) What is a file in C programming ? Explain 10
the use of fopen function in file handling.
Explain different mode in which a file can
be opened.
(b) What is a pointer ? Write a C program 10
using pointer to print the name and price
of the items sold in a retail shop on a specific
date.
5. (a) What is a structure ? Explain how a 10
structure is declared in C. Write a program
in C using structure to store records of
students in a class of 20 students.
(b) Write a C program to demonstrate the use 5
of switch - case statement.
(c) What is recursion ? Write a recursive 5
C program to find the factorial of a given
number.
MCS-011 3