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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment