Re-appear PGDCA I (First) Semester Examination 2014-15

Course Code:PCA102 Paper ID:X801102

Programming in ā€˜Cā€™ Language

Time: 3 Hours Max. Marks: 70

Max Marks: 75 Note: Attempt six questions in all. Q. No. 1 is compulsory. 1. Answer any five of the following (limit your answer in 50 words). (4x5=20) a) What is basic importance of C language? b) What is expression? What kind of information is represented the expression? c) What is the role of control variable in for statement? d) What are differences between array and string? e) What do you mean by recursion? How it is different than iteration? f) What are input and output functions written in C for files? g) Create a string constant with the # define statement. How does this constant differ from character constant? h) Differentiate between Standard Library function and user defined function?

2. What do you mean by operators? Explain different types of operators available in C with suitable examples. (10)

3. a) What is the purpose of while and do-while statements? Explain with example. (5) b) Write a program to calculate the area of triangle and circle depending upon the choice entered by the user. (5)

4. a) What is purpose of keyword void in function declaration? What is the purpose of void in function definition? (5) b) Prepare a function program to sort an array of integers into ascending order. (5)

5. a) Differentiate Call by Value from that of Call by Reference with the help of an example. (5) b) What is static and dynamic memory allocation? Also explain merits and demerits of static and dynamic memory allocation.

(5) 6.a) Can a structure be within a structure? Give appropriate examples to support your answer. Also explain uses of structure. (5) b) Write a program to declare structure as a member of a union and display its contents. (5)

7. What is the purpose of the following functions: (2x5=10) i) fopen() ii) fclose() iii) fread() iv) ftell() v) fseek

8. Write short notes on any two of the following: (5+5) a) File handling b) Preprocessor Directives c) Control statements.