Вы находитесь на странице: 1из 3
Fourth Semester B.Tech. Degree Examination, February 2016 (2013 Scheme) 13.405 : COMPUTER PROGRAMMING (T) Time :3 Hours Max. Marks °1 PART-A Answerall questions : (10%2=20 Marks) 1. Raising a number ‘n’ to a power ‘pis the same as multiplying n by itself times. ‘Write function power() that takes a double value for n and an integer value for p ‘and retums the result as 2 double value. Wrte a main() function to test power). 2 What do you mean by dynamic binding ? How itis useful in OOP? 0 ‘3. Whatis the signiticance of scope resolution operator ? 4. Whats intine function ? When will you make a tunction inline andi why ? he following statements 2 le SE RAN i ty fi question fromeach Module. Each question carries 20 marks. Siglo: aah ie 11. a) Exolain about ifetime, visibility. intialization values and purpose of automatic, ‘Static and external variables. 'b) Write a function called reverse() that reverses asstring (an array of char). Write ‘program to get a string from the user, call reverse() and print the result. 12, a) Differentiate between the methods of passing an argument to a function by. "value and by reference. Write programs to swap the values of tvro variables using pass by value and pass by reference. > 'b) Write a function to find the sum of digits of a given number. Write a main() function to test this function. ‘Module—it 13. a) Explain the use of constructor and destructor in a class with suitable Pe: hy Module=m 15, a) Explain the use of virtual functions with a sultable example. if b) Create a class called ‘time’ that has separate integer data mer hours, minutes and seconds, Overload the +! operator to add twottimes. 46, a) Write a C+ program to write the string *Weloome to G**" ina textfi ‘exam, txt. ») Differentiate between function overloading and function overriding with suitable examples. ‘Module ~1V 10, pS Gee) 2 Si aNi8 12 44 48. a) Write a program to implement the basic operations of a queue using ) Write a program to sort n numbers using selection sort algorithm. ACADEMY B-TECH/M.TECH TurTions & PROJECTS: ‘Near LBS College, Trivandrum Ph 0496782706 “srassociatestrivandrum@zmail.com