Friday, December 19, 2008

MCS-011 : PROBLEM SOLVING AND PROGRAMMING, Dec. 05

MCA (Revised)
Term-End Examination
December, 2005

MCS-011 : PROBLEM SOLVING AND PROGRAMMING

Time : 3 hours Maximum Marks : 100
(Weightage 75%)

Note : Question number 1 is compulsory. Attempt any three questions from the rest.

1. (a) Write an algorithm and draw a corresponding flowchart to search a number in the given list of numbers and also display its position. 10

(B) Write a Menu driven program in C to add, subtract and multiply two distances which are given in feet and inches, [e.g. 3 ft 9 inches + 2 ft 5 inches =
6 ft 2 inches] 10

(c) Write a recursive program in C to find whether a given five digit number is a palindrome or not. 10

(d)Write a program in 'C' to print automorphic numbers. The automorphic number is a number in which the square of the number contains the number in the end.
Example : (a) 5 ; 25 (B) 6 ; 36 10

2.(a) Design an algorithm and draw corresponding flowchart to find all the prime numbers between two given numbers 'm' and 'n', where m, n > 0. 10

(b)Design an algorithm and write a program using 'C' to compute transpose of a matrix. 10

3.(a)Write a program to process the marks for 4 courses in a semester. Each course contains 2 components namely internal assessment and external examination. Students need to pass in both the components individually by acquiring at least 40% in order to declare successful completion in a course.
Compute the total marks average and also display the Grade accordingly. 10

Note : You should use "Structures" concept.

(b)Write the functions to perform the following : 10

(i) To accept a string and print the rightmost "n" characters.
(ii) To accept any two strings and check whether the first string is a substring of the second string.

4.(a)Write a program in 'C to find the length of a given string including blank spaces, tabs and other special symbols (new line character should be taken as a
string terminating character).
Note : You should use "pointers" concept. 10

(B) Write macros for the following :
(i) To find the value of P [(1 + i) to the power n]
P, i, n are arguments of a macro and n is an integer. 5

(ii) To find the maximum of two numbers A, B where A and B are arguments of a macro. 5

5.(a)Write a program in 'C to append some characters in an already existing file and also find the number of characters in the resultant file after appending. 10

(b)Design an algorithm and draw corresponding flowchart to convert a decimal number to its hexadecimal equivalent. 10

No comments:

Post a Comment