MCS-011 : PROBLEM SOLVING AND PROGRAMMING
Paper 1
Time : 3 hours Maximum Marks : 100
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.
(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]
C. Write a recursive program in C to find whether a given five
digit number is a palindrome or not.
(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
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.
(b)Design an algorithm and write a program using 'C' to compute
transpose of a matrix.
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.
Note : You should use "Structures" concept.
(b)Write the functions to perform the following :
(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.
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.
(ii) To find the maximum of two numbers A, B where A and B are
arguments of a macro.
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.
(b)Design an algorithm and draw corresponding flowchart to convert
a decimal number to its hexadecimal equivalent.
|