You are on page 1of 1

First Semester PROBLEM SOLVING AND COMPUTER PROGRAMMING IN C Time: Three Hours Maximum :75 Marks Answer any

five questions. All Questions carry equal marks. 1. (a) Why should programs be readable? How should variable names be chosen to improve readability? (5 marks) (b) Explain the different levels of programming languages with advantages and disadvantages of each. (5 marks) (c) Define the term algorithm. Give a suitable example. (5 marks) 2. (a) Explain the importance of flowcharts in program development. (5 marks) (b) What are subscripted variables in C? Mention their usage. (4 marks) (c) What do you understand by control flow structure? (4 marks) (d) Explain the need of implicit type conversion. (2 marks) 3. (a) Illustrate with an appropriate example, the use of the XOR operator ^.(4 marks) (b) Explain various storage classes in C and its suitability with appropriate examples. (4 marks) (c) Describe various escape sequences which can be used in the printf() library function. (7 marks) 4. (a) Compare and contrast the following :(i) Pass by value and pass by reference (2 marks) (ii) Local variables and global variables (2 marks) (iii) Static variables and register variables (2 marks) (b) Mention the role of parenthesis in C programs. Give illustrations. (5 marks) (c) Compare the while loop with the do..while loop quoting examples (4 marks)

5. (a) How would you declare a structure in C? Give examples. (5 marks) (b) Describe the features of C programming language (5 marks) (c ) Describe the goto statement in C language with an example (5 marks) 6. (a) What a C program to print the prime numbers in the Fibonacci series.(7 marks) (b) What is a recursive function? How does it help a programmer in developing a program? Give a recursive as well as a non-recursive C function to calculate the factorial of a non-negative integer. (8 marks) 7. (a) List some commonly used library functions in C language, along with their definition. (5 marks) (b) Distinguish between direct and indirect recursion. (3 marks) (c) Explain the use of malloc() function in C with example. (3 marks) (d) Using a function for swapping the elements, write a program in C to sort the given array of N integers. (4 marks) 8. (a) Discuss the suitability of C language for system programming. (7 marks) (b) Declare structure to handle complex numbers. Write functions to add, subtract, multiply and divide two complex numbers. The functions should return the result. (8 marks)

You might also like