Вы находитесь на странице: 1из 3

No.

of Printed Pages : 3 MCA (Revised) Term-End Examination June, 2012 fl

MCS-011

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) It is said that 'C' is a middle level language. Mention those features of 'C' which enables this description. Give a short note on the 'compilation process in 'C'. (b) Develop a flowchart and then write a program in 'C' to sort strings passed to the program through command line arguments. Also display the sorted strings. Define 'pointers' in C. How is a Pointer variable declared ? Give examples and explain. Enumerate the utility of Pointer variables, with an example. 1 10

10

(c)

10

MCS-011

P.T.O.

(d) Differentiate between : (i) Function and sub routine

21/2x2=5

(ii) Structure and Union with examples of each. (e) Give the precedence chart for the operator in 'C'. (a) Differentiate between an execution error and a syntax error. Give examples of execution and syntax errors. Write and explain the action of 'WHILE' statement. Develop a program to compute the average of every 3rd integer lying between 1 and 100. Write a program in 'C' to copy the contents of one file to another file. 4

(b)

(c) 3.

8 5

(a) Write a program in 'C' to compute the series :


(x) + (x + n) + (x + n2) + (x + n3) +

for a total of m terms. Where m, n and x are to be accepted by the user. (b) (c) Differentiate between goto statement, break and continue. What is an assignment operator ? Give example of its usage. 2 4 3

MCS-011

(d) What is a pointer to an array? Differentiate it from an array of pointers. Write a program using pointer to array to calculate the sum of n given numbers. 4. (a) Implement Binary search in 'C' language. (b) With every use of a memory allocation function, what function must be used to release allocated memory which is no longer used ? Give syntax also. Write a recursive function in 'C' to count the number of nodes in a singly linked list.

8 4

(c)

5.

(a) How are arrays processed in 'C' ? Illustrate with the help of 2-D arrays as examples. (b) Give syntax of gets ( ) and getch ( ) ? Also give examples of usage of scanf ( ) and printf O. (c) A program in 'C' language contains the following declaration : Static int x[8] = {1,2,3,4,5,6,7,8}; What is the meaning of : (i) x? (x + 2) ? (iii) *x? (iv) *(x + 2) ? Explain the results.

6 6

MCS-011

Вам также может понравиться