*8233*
8233
(Pages : 2)
Reg. No. : ..................................... Name : ..........................................
Third Semester B.Tech. Degree Examination, November 2009 (2008 Scheme) 08.302 : PROBLEM SOLVING AND PROGRAMMING IN C (RF) Time : 3 Hours
Max. Marks : 100 PART – A
Answer all questions. 1. Explain the problem solving strategy “breaking a problem into sub problems” with an example. 2. What is meant by debugging of programs ? Give examples of debugging tools. 3. Give the flow chart and algorithm for finding the sum of the squares of first ‘N’ natural numbers. 4. What is conditional compilation ? Explain with an example. 5. What are the basic data types in C ? Compare them on the basis of values they can have. Also mention different qualifiers in C. 6. Write a C program to implement selection sort. Show its working with the input : – 8, 0, 1, 4, 10, 12. 7. Write a C program to check a given string is palindrome or not. 8. Show the use of array of pointers with an example containing strings. 9. How are data files handled in C ? Give examples. 10. Differentiate between functions and macros with examples.
(10×4=40 Marks)
PART – B Answer any one full questions from Each Module. Module – I 11. a) Explain about various input and output devices and their working principles. b) Explain : i) Documentation of programs. ii) Top-down Design. OR
10 5 5 P.T.O.
*8233*
8233
12. a) What is a data structure ? Give examples. How important is selecting a suitable data structure for a particular problem ? 10 b) Explain : i) Importance of problem definition phase. ii) Compare primary and secondary storage devices of a computer.
5 5
Module – II 13. a) Explain how strings are handled in C. Give suitable examples. b) Write a C program to implement linear search for a list of strings. Show its working with an example.
10 10
OR 14. a) Write a C program to print the binary representation of an unsigned integer. Show how it works for an input 160. b) How does C enable working with bits ? What are the advantages on working with bits ? Give examples.
10 10
Module – III 15. a) What are pointers ? How are pointers important in function call by reference ? Give examples also. 10 b) Use structures to store the following details of 40 students in a class : Name, Class Number, Blood Group and marks of 6 subjects. Use pointers to access structure members and find the average marks of each student. Display the details like : 10 Name → Class Number → Blood Group → Average Mark. OR 16. a) Accept a file name as command line argument in a C program. Also accept a string from the user. Write the count of each character into the given file. Display file contents. 12 b) What are recursive functions ? How are they different from normal functions ? Give any 3 problems that can be represented as recursive functions. _______________
8