Showing posts with label MCS-011 QUESTION PAPER. Show all posts
Showing posts with label MCS-011 QUESTION PAPER. Show all posts

Friday, December 19, 2008

MCS-011: PROBLEM SOLVING AND PROGRAMMING June-2008

MCA (Revised)
Term-End Examination June. 2OO8
MCS-011: PROBLEM SOLVING AND PROGRAMMING
Time : 3 hours Maximum Marks : 1OO

1. (a) Design an algorithm, draw a corresponding flowchart and then write a program in C to convert a given string to lower case.

(b) Write an algorithm and program in C to generate fibonacci series. Use recursion.

(c) Draw a flowchart and write a program in C to calculate the number of vowels in a given string.
.
(d) What do you mean by 'array of pointers' ? Write a program in C to calculate the difference of the corresponding elements of two arrays of integers of same size.

2.(a)Write the usage of the following (with an example of each):
(i) *define
(ii) enum

(b)Write a macro for the following :
(i) to find the smallest number among 3 given numbers.
(ii) to find the factorial of a given number N.

(c)What are the difference between structure and union ? Give one illustrative example of usage o{ the union.

3.(a) Write a program in C, using structures to generate a report for employees which displays the total salary,designation, department, address etc. Assumptions can be made wherever necessary.

(b)Write a program to read formatted data from the file.

(c)Give a brief note on null pointer assignment. Write a program in 'C' to illustrate this concept.

4.(a) Write a program which reads a file and counts the number of lines and words in the file, assuming that a line can contain at most 80 characters.

(b) Give differences between:

(i) Sequential and Random Access files
(ii) Global variable and Local variable

(c) Write a program and flowchart to display the
following patten:
1
2 3
4 5 6
7 8 9 1 0
11 12 13 14 15
16 17 18 19 20 2l

5,(a) Write a program in C to find the difference between two matrices of size(3x3).

(b)Write a program in C to sort a given list of numbers
using bubble sort. Draw corresponding flowchart.


(c) Explain meaning of following prototypes and
mention return data type of each of-them :
(i) int (*f) (char*);
(ii) int *f (char*);
{iii) double f (int a, int b, char c);
(iv) unsigned f( );

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec. 2006

MCA (Revised)
Term-End Examination
December, 2006
MCS-011 : PROBLEM SOLVING AND PROGRAMMING

l. (a) Write an algorithm and draw a corresponding flow chart to print the sum of all integers starting from 2 to the given positive integer x where x > 2.

(b) Write a recursive program in 'C' to find the L.C.M. (Least Common Multiple) of two given numbers.

(c) Write a program in 'C' to print the following
format :
C
C C C
C C C C C
C C C C C C C
C C C C C C C C C

(d) Write a non-recursive procedure in 'C' for calculating
power of a number 'm' raised by another number 'n'.

2.(a)Design an algorithm and draw corresponding flow chart to print the value of the number in words when the number entered is in the range of 1 to 299.

(b)Using pointers, write a program in 'C' to count the
occurrence of each character in a given string.

3. (a) Write a program in 'C' that accepts 10 words of varying length and arranges the words in the descending order of word length. [use array].

(b)Write a program in 'C' for the multiplication of two matrices.

4.(a)
Write a program in 'C'to check whether a given string is palindrome. (use Pointers).

(b)Write a program in 'C'for the addition of two polynomials.use Arrays and Structure

5.(a)Write a program in 'C' that accepts two files as input and creates a new file whose contents include the contents of two input files.

(b) Consider a data file containing some records of type STUDENT :

Struct STUDENT
{
char Name[20];
int Roll_No;
float marks;
} ;

(i) Write a function, which takes file name as an argument and returns the number of records in that file.

(ii) Write a function, which takes two arguments :
filename and Roll_No(s) and deletes the corresponding records with these Roll_Nos from that file.

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec-2007

MCA (Revised)
Term-End Examination
December, 20O7
MCS-011 : PROBLEM SOLVING AND PROGRAMMING
Time : 3 hours Maximum Marks : 700

(i) Question number 1 is compulsory'
(ii) Attempt any three questions from the rest.

1. (a) Design an algorithm, draw a corresponding flow chart and write a 'C' program for Binary Search, to search a given number among the list of numbers.

(b) Write the syntax for the declaration of a function.also discuss the parameter passing method with an example program.

(c)Write a recursive function in 'C' that computes the factorial of a given integer

(d)List and explain the precedence of Arithmetic, Logical and Relational operators in 'C'.


2.(a)Write an algorithm and draw flowchart to find whether a given string s1 is substring of another string s2.

(b)Write a program in 'C' language which accepts the enrollment number of a student as input and prints the name of that student. The program should initially store information about the (name,enrollment number) pairs of students in the form of
a matrix.

3.(a)Write a program in 'C' language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers.

(b)Explain any five functions of library.

4(a)Write a program in 'C'that accepts a sentence 's'and a word 'w'as input. Now, the program should print the starting position of right-most occurr ence of 'w'in 's'.

(b)Write a program in 'C' language that accepts the name of a file as input and prints those lines of the file which have the word 'this'.

5. (a)Write a program in 'C'language to convert decimal number into binary number.

(b) Write a program in 'C'language to add two matrices.

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec-2008

MCA (REVISED)
TERM –END EXAMINATION
DECEMBER, 2008

MCS-011 : PROBLEM SOLVING AND PROGRAMMING Dec-2008

QUESTION NUMBER 1 IS COMPULSORY. ANSWER ANY THREE QUESTIONS FROM THE REST.

1 (a) DESIGN AN ALGORITHM, DRAW A CORRESPONDING FLOW CHART AND WRITE A PROGRAM IN C TO FIND THE FACTORIAL OF A GIVEN NUMBER USING RECURSION.

(b) WRITE A C PROBRAM TO FIND WHETHER A GIVEN FIVE DIGITS NUMBER IS A PALINDROME.

(c) WIRTE A PROGRAM IN C TO FIND ALL ARMSTRONG UUMBERS IN THE RANCE OF 0 AND 999.
HIND: AN ARMSTRONG NUMBER IS AN INTEGER SUCH THAT SUM OF TH CUBES OF ITS DIGITS IS EQUAL TO THE NUMBER ITSELF, EG.:153 IS ARMSTRONG NUMBER.

(d) WHEN CAN TWO MATRICES OF ORDER M * N AND P*Q BE MULTIPLIED? ALSO WRITE A PROGRAM IN C TO MULTIPLY TWO SUCH MATRICES.


Q2 (a) WRITE A PROGRAM IN C TO GENERATE A PROGRESS REPORT FOR STUDENTS WHICH DISPLAYS THE TOTAL MARKS, AVERAGE, AND GRADES. THE INPUT FOR THE SYSTEM AND MARKS SECURED IN FIVE COURSES)ASIGNMENTS AND TERM END EXAMINATION). PASS(40%) IN BOTH TEH COMPONENTS ARE COMPULSORY. GRADES MAY BE GIVEN ACCORDINGLY. ASSUMPTIONS CAN BE MADE IF NECESSARY AND SPECIFY THEM.

(b). WHAT IS THE DIFFERENCE BETWEEN "&" AND "&&"? EXPLAIN WITH AN EXAMPLE.

(c). WRITE A LOOP THAT CALCULATE SUM OF THE n ELEMENTS OF THE SERIES:

1+7+13+19+25+......

WRITE THE LOOP IN 3 DIFFERENT WAYS:
(i) USING WHILE LOOP

(ii) USING DO-WHILE LOOP

3. (a) WRITEE A MACRO TO FIND OUT WHETHER THE GIVEN CHARACTER IS LOWER CASE OR NOT.

(b). WIRTE A PROGRAM IN C TO CHECK WHETHER THE GIVEN YEAR IS LEAP OR NOT. ALSO EXPLAIN THE LOGIN F THE PROGRAM.

(c). WRITE A FUNCTION DEFINITION TO FIND THE SMALLEST AMONG THE FIVEN THREE NUMBERS.



4. (a) WITHOUT SUING THE 'STRCPY' FUNCTION, WRITE A PROGRAM TO COPY CONTENTS OF STRING 2 TO STRING1, AND FIND THE LENGHT OF THE COPIED STRING USING POINTERS.

(b). WRITE THE USAGE OF THE FOLLOWING DATA TYPES, WITH AN EXAMPLE FOR EACH.
(i) ENUMERATED DATA TYPE.

(ii) TYPEDEF.



5(a). DESIGN AN ALGORITHM AND DRAW CORRESPONDING FLOW CHART TO CONVERT A DECIMAL NUMBER TO ITS HEXADECIMAL EQUIVALENT.

(b) EXPLAIN THE FOLLOWING STORAGE CLASS SEPCIFIERS OF A VARIABLE IN TERMS OF DEFAULT VALUE, LIFETIME, SCOPE PURPOSE ANDLIMITATIONS (WITH AN EXAMPLE)

(i) AUTO

(ii) REGISTER

MCS-011 : PROBLEM SOLVING AND PROGRAMMING June-2007

MCS-011
MCA (Revised)
Term-End Examination
June, 2007

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) Design an algorithm, draw a corresponding flow chart and write a program in C, to swap the values using pass by value and pass by reference methods. 10

(B) Write an algorithm and program in C to print fibonacci series. 10

© Write a program to generate the pattern 10

1 2

1 2 3

1 2 3 4

1 2 3 4 5

(d) When can 2 matrices of order a x b and c x d be multiplied ? Also write a program in C to find the product of 2 such matrices. 10

2. (a) Explain the concept of a function returning a pointer with an example. 6

(B) Write a macro to find the sum of n numbers. 7

© Write a program in C, to copy filel to another file2 in the same directory. 7

3. (a) Draw a flow chart and write a program in C to sort a given list of numbers. 7

(B) Write a program in C to compare two strings without using String Compare function. 5

© Explain various types of storage classes in C with example for each. 8

4. (a) Explain use of comma operator in C with the help of an example. 5

(B) What is the difference between & and && ? Explain with an example. 5

© Write a program in C using structures to simulate salary calculation for employees of a company. Assumptions can be made wherever necessary. 10

5. (a) Write a program to count the number of characters and words in a given file. 10

(B) Write a program to display the string "EARTH" in the following format : 10

E

E A

E A R

E A R T

E A R T H

E A R T

E A R

E A

E

MCS-011 : PROBLEM SOLVING AND PROGRAMMING June-2006

MCA (Revised)
Term-End Examination
June, 2006

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) Design an algorithm, draw a corresponding flow chart and write a program in C, to print the fibonacci series. 10

(b) Write a program that does not use the inbuilt string functions to perform the following : 10

(i) to compare two strings
(ii) to copy a string

© Design an algorithm, and write a program to find the factorial of a number using recursion. 10

(D) A C program contains the following declarations : 10
int i, j;
long iX
short S
float X.
double dX;
char C;

Determine the resultant data type of each of the following expressions :

(i) i + C
(ii) X + C
(iii) dX + X
(iv) ((int) dX) + iX
(v) i + X
(vi) S + j
(vii) iX + j
(viii) S + C
(ix) iX + C
(x) i + 1

2. (a) Summarize the purpose of the format strings (like %s, %d, %c) that are commonly used within the printf function, with an example for each. 10

(b) When can two matrices of order a x b and c x d be subtracted ? Also write a program in C to find the difference of two such matrices.10

3 (a) Design an algorithm, draw a corresponding flow chart and write a C program to check whether a given string is a palindrome or not. 10

(b) Explain the meaning of each of the following functions prototypes and mention the return data type of each of them : 10

(i) double f(double a, int b);
(ii) void f(long a, short b. unsigned c);
(iii) unsigned f(unsigned a. unsigned b);
(iv) int (*f) (char*, int);
(v) int * f(char*. int);

4. (a) What is the difference between a function and a macro? Find the largest number among two numbers using a function definition as well as a macro. Which is more efficient in terms of execution time and code size ? 10

(b) Write a program to sort a list of strings in alphabetical order, using an array of pointers. 10

5.(a) Write a program, using "structures', to calculate the gross salary and net salary, if the details of an employee along with the basic pay, attendance and
deductions are given as input. 10

(b) Write a program to count the number of characters, number of words and number of lines in a given file. 10

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