Sunday 14 April 2013

CDS (UNIT-3) FREQUENTLY ASKED QUESTIONS

1. (a) What is a Preprocessor directive?
(b) Distinguish between function and Preprocessor directive?
(c) What is the significance of Conditional Compilation?
(d) How does the undefining of a pre-defined macro done?

2. (a) Write a program to demonstrate passing an array argument to a function? Consider the problem of finding largest of N numbers defined in an array.
(b) Write a recursive function power(base, exponent) that when invoked returns base exponent?

3. What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values?

4. (a) Distinguish between the following.
(i) Actual and Formal arguments?
(ii) Global and Local variables?
(iii) Automatic and Static variables?
(b) Explain in detail about pass by value and pass by reference. Explain with a sample program?

5. (a) Distinguish between formal variable and actual variable.
(b) Distinguish between Local and Global variable.
(c) Distinguish between Call by value and Call by reference.

6. (a) What is the syntax followed in the definition of a macro?
(b) What are the advantages and disadvantages of macros?
(c) What is meant by conditional compilation? What are its advantages?

7. (a) What are the advantages and disadvantages of recursion?
(b) Write a C program to find the factors of a given integer using a function.

8. (a) Give some important points while using return statement.
(b) Write short notes on scope of a variable.

9. (a) Write short notes on auto and static storage classes.
(b) Write short notes on call by reference.

10. (a) Distinguish between user defined and built-in functions.
(b) What is meant by function prototype? Give an example for function prototype.

11. (a) Distinguish between getchar and scanf functions for reading strings.
(b) Write a program to count the number of words, lines and characters in a text.

12. (a) What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values.
(b) Write a C program that uses a function to sort an array of integers.

13. Define an array. What are the different types of arrays? Explain

14. (a) Write a C program to do matrix multiplications.
(b) Write in detail about one dimensional and multidimensional arrays. Also write about how initial values can be specified for each type of array.

No comments:

Post a Comment