MCA Examination, December 2021
Problem Solving Using C · Semester 1
Paper code: MCA-89(N) · Subject code: MCA-112
Time: Three hours · Maximum marks: 70
Attempt all sections as per instructions.
The printed header also says B.Tech. Semester I. The examination heading and subject code identify the paper as MCA.
Section A – Very Short Answer Questions
Attempt any five questions. 5 × 2 = 10
- What are the key features of C?
- Define nested loops in C with an example.
- Define the basic data types available in C.
- Write an algorithm to compute F=1/N! for a given N.
- For i=−3, j=2 and k=0, find X for
X = ++j - ++i && ++k;.
Section B – Short Answer Questions
Attempt any two questions. 2 × 9 = 18
- State the difference between do-while and while loops. Write a program to sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + … + 1/n for a given n.
- Write short notes on:
- Pointers to structure (3 marks)
- File handling functions (3 marks)
- Array of pointers (3 marks)
- What is the difference between a structure and a union? Write a C program using a union to create a faculty record with faculty ID, name, subject and department. Accept and print details of five faculty members.
Section C – Descriptive Answer Questions
Attempt any three questions. 3 × 14 = 42
- Identify the output of the following programs:
- A two-dimensional array and pointer example. See printed page 4, where parts of the declaration are illegible. (4 marks)
- An array assignment inside a while loop. See the partly obscured code on printed page 5. (6 marks)
- A switch on
color = 2with cases 0: Black, 1: Blue, 2: Yellow, 3: Green and default: Other. See the original code on printed page 5. (4 marks)
- Write a program to compare text1.txt and text2.txt character by character and indicate whether they are the same. (7 marks)
- How are binary files different from text files? (3 marks)
- What is the use of “freek()” [as printed] in handling a file? (4 marks)
- Write the algorithm and flowchart for:
- Finding the sum of all even numbers in an integer array. (7 marks)
- Finding the occurrence of a substring in a large string. (7 marks)
- Differentiate between pass by value and pass by reference in C. (7 marks)
- Write a C program to multiply two matrices using functions. (7 marks)
- Define pointer to a pointer in C. (3 marks)
- Read a string into an array named TEXT and use a pointer named Ptr to find its length. (4 marks)
- State the output when “Programming in C” is given as input to the program on printed page 7. (7 marks)
- Use an array of structures to represent people in different age groups, storing name, address, phone, email, spouse and salary. Define a function to display the requested person’s details. [Last few words unclear.] (7 marks)
- Differentiate between static and dynamic memory allocation. Dynamically create two 10-element integer arrays and find their element-wise product. [Only the name “SECOND” is visible.] (7 marks)

