0% found this document useful (0 votes)
150 views25 pages

Problem Solving and Programming

This document contains sample questions from a MCA degree examination in Problem Solving and Programming. It is divided into three parts - Part A contains 10 multiple choice questions worth 2 marks each, Part B contains 5 questions worth 13 marks each, and Part C contains 1 question worth 15 marks. The questions test concepts like algorithms, program verification, control structures, functions, pointers, files, and data structures in C programming.

Uploaded by

Alia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views25 pages

Problem Solving and Programming

This document contains sample questions from a MCA degree examination in Problem Solving and Programming. It is divided into three parts - Part A contains 10 multiple choice questions worth 2 marks each, Part B contains 5 questions worth 13 marks each, and Part C contains 1 question worth 15 marks. The questions test concepts like algorithms, program verification, control structures, functions, pointers, files, and data structures in C programming.

Uploaded by

Alia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Reg. No.

Question Paper Code : J1353

M.C.A. DEGREE EXAMINATION, FEBRUARY/MARCH 2018.

First Semester

DMC 7102 — PROBLEM SOLVING AND PROGRAMMING

(Regulations 2013)

Time : Three hours Maximum : 100 marks

Answer ALL questions.

PART A — (10  2 = 20 marks)

1. Distinguish program and algorithm.

2. What is program verification?

3. List the arithmetic operators in C.

4. What is a pseudo code?

5. List the various scope rules.

6. Differentiate recursion vs. iteration.

7. Which operators are related with pointers?

8. Write the purpose of size of operator in pointers.

9. Differentiate struct and union.

10. What is # and ##?

PART B — (5  13 = 65 marks)

11. (a) Analyze the Recursive Quick Sort algorithm and find the time
complexity. (13)

Or
(b) Explain top down design in problem solving with an example. (13)
12. (a) (i) Show the different if control statements with an example for each.
(6)
(ii) Write a C program to calculate the incentive amount of a sales
person based on their annual sales amount
0 to 10,000 – 10% of sales amount
1,000 to 20,000 – 20% of sales amount
2,000 to 30,000 – 25% of sales amount. (7)

Or
(b) (i) What is multiple selection switch statement? Write its syntax. (4)
(ii) Write a C program to compute the EMI amount for a customer’s
purchase on loan using switch control statement.
Number of years EMI
1 10% of loan
2 11% of loan
3 12% of loan
4 14% of loan
5 15% of loan. (9)

13. (a) (i) Explain counter controlled repetition with while loop. Give an
example. (9)
(ii) What is the purpose of header files? Give examples. (4)

Or
(b) (i) What is sentinel controlled repetition? Give example. (4)
(ii) What is an array? Write a program to compute Mean and Median
using arrays. (9)

14. (a) (i) How arguments are passed to a function using references? (10)
(ii) What is array of pointers? Give an example. (3)

Or
(b) What are the string handling functions available in C? Write user
defined functions for string copy, string compare and substring. (13)

15. (a) How formatting input is done in scanf( ) statements? Give an example for
each. (13)

Or
(b) Write a program in C to reverse the contents of a file using random
access file mode. (13)

2 J1353
PART C — (1  15 = 15 marks)

16. (a) Write a C program to find the minimum number in a list of 'N' numbers.
Analyse its time complexity.

Or

(b) Write a C program to check whether all the elements in a given away of
'n' elements are distinct.

——————————

3 J1353
Reg. No. :

Question Paper Code : BS2353

M.C.A. DEGREE EXAMINATION, AUGUST/SEPTEMBER 2017.

First Semester

DMC 7102 — PROBLEM SOLVING AND PROGRAMMING

(Regulations 2013)

Time : Three hours Maximum : 100 marks

Answer ALL questions.

PART A — (10  2 = 20 marks)

1. Define modularity.

2. What does program verification refers to?

3. Define the logical operators in C language.

4. Write a C program to accept two numbers compute its sum and print the
result.

5. Illustrate with an example the use of switch statement in C language.

6. Define recursion.

7. What is a pointer? Give example.

8. Define the bitwise operators in C language.

9. State the difference between sequential access file and random access file.

10. Define a macro in C language. Give example.

PART B — (5 × 13 = 65 marks)

11. (a) What is top-down design? Explain with an example. (13)

Or
(b) (i) Explain with an example verification of program segments with
loops. (8)
(ii) Explain worst and average case behavior of an algorithm with an
example. (5)
12. (a) (i) Explain integer constants and real constants in C language with an
example. (6)
(ii) Write a C program that converts the given temperature in
Fahrenheit to Celsius using the following conversion formula.
F  32
C  (3)
1 .8

(iii) Write a C program to accept a number, check whether the number


is a prime number or not and print the result. (4)

Or
(b) (i) Write a C program to print the first ‘N’ Fibonacci numbers. (5)
Note : The Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,.....N
where each number is the sum of the preceding two.
(ii) Write a C program to perform computation of sin (x) as given
below : (8)
3 5 7 9
x x x x
sin x  x     .......... . N terms.
3! 5! 7! 9!

13. (a) (i) Explain entry-controlled loop and exit-controlled loop with an
example. (7)
(ii) What is a function? Explain with an example. (3)
(iii) Write a C program to compute factorial of a given number using
recursion. (3)

Or
(b) (i) Write a C program to store ‘N’ names in an array. (6)
(ii) Write a C program to sort an array of ‘N’ numbers in ascending
order. (7)

14. (a) (i) Write a C program using pointers to find the length of a character
string. (5)
(ii) What is array of pointers? Explain with an example in C language.
(5)
(iii) Explain enumerated types in C language with examples. (3)

Or
(b) Explain structures and unions in C language with an example. (13)

2 BS2353
15. (a) What is a file? Explain with an example the file handling functions. (13)

Or
(b) A file with name DATA contains a series of integer numbers. Write a C
program to read these numbers and then write all odd numbers to a file
called ODD and all even numbers to a file called EVEN. (13)

PART C — (1 × 15 = 15 marks)

16. (a) Write a C program to accept student personal and academic details and
store in it a file. Print students’ mark sheet.

Or
(b) (i) With example explain pointers to function. (10)
(ii) Give an account on predefined symbolic constants. (5)

—————————

3 BS2353

You might also like