*3125*
3125
(Pages : 2)
Reg. No. : .................................... Name : .........................................
Third Semester B.Tech. Degree Examination, June 2009 (2003 Scheme) ++ 03-303 : C PROGRAMMING (BH) Time : 3 Hours
Max. Marks : 100
Instructions: Answer all questions from Part – A and one question each from each Module of Part – B. PART – A 1. Explain how a floating point number is stored inside a computer. 2. Write a C++ program to convert binary to decimal in C++ ? 3. Why array index starts from 0 (zero) only ? 4. What are Virtual functions ? How to implement virtual functions in “C++” ? 5. What are Virtual Functions ? How to implement virtual functions in “C++”. 6. What is the difference between structures and classes in C++ ? 7. What is virtual constructors/destructors ? 8. What are the advantages and disadvantages of inheritance ? 9. What is a friend function ? Briefly explain its advantages. 10. What is the apt data structure to sort a stream of integers ? Explain. (10×4=40 Marks)
P.T.O .
*3125*
3125 PART – B Module – I 11. a) Write a C++ program to find solution to the following series :
12
X X2 X3 Xn 1+ + + + ......... + 2! 4! 6! 2n!
b) With the help of a C++ program show how an if ........... structure can be replace by a case structure ? OR 12. Write C++ program to determine inverse of a matrix.
8 20
Module – II 13. a) What are the rules for operator overloading ? b) Write a C++ program to overload operators +, –, *, == for a matrix class for matrix operations . OR 14. a) Write a C++ program, using overload constructor, to add two complex numbers. b) What is meant by Virtual base class ? Explain.
5 15 15 5
Module – III 15. Write a C++ program to implement the following class hierarchy. Use the concept of Hybrid inheritance. 20
OR 16. a) What are operations in a QUEUE ? Explain with example. b) Write a C++ program to create a stack to substitute an array of characters. ______________
5 15