You are on page 1of 3

QUESTION PAPER- C/C++

SET-2

1.Which of the following is not the member of class? A.Static function B. Friend function C. Const function D.Virtual function

2.How many instances of an abstract class can be created? A.1 B. 5 C. 13 D.0

3.Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ? A.rem = 3.14 % 2.1; B. rem = modf(3.14, 2.1); C. rem = fmod(3.14, 2.1); D.Remainder cannot be obtain in floating point division.

4.Which of the following special symbol allowed in a variable name? A.* (asterisk) B. | (pipeline) C. - (hyphen) D._ (underscore)

5.When we mention the prototype of a function? A.Defining C. Prototyping

B. Declaring D.Calling

6.What is (void*)0? A.Representation of NULL pointer B. Representation of void pointer C. Error D.None of above

7.A pointer is A.A keyword used to create variables B. A variable that stores address of an instruction C. A variable that stores address of other variable D.All of the above

8.How will you free the allocated memory ? A.remove(var-name); C. delete(var-name);

B. free(var-name); D.dalloc(var-name);

9.What is the similarity between a structure, union and enumeration? A.All of them let you define new values B. All of them let you define new data types C. All of them let you define new pointers D.All of them let you define new structures 10.Which of the following statement is correct? A.Overloaded functions can have at most one default argument. B. An overloaded function cannot have default argument. C. All arguments of an overloaded function can be default. D. A function if overloaded more than once cannot have default argument. 11.Which of the following statement is incorrect? A.Default arguments can be provided for pointers to functions. B. A function can have all its arguments as default. C. Default argument cannot be provided for pointers to functions. D.A default argument cannot be redefined in later declaration.

12.Where the default value of parameter have to be specified? A.Function call B. Function definition C. Function prototype D.Both B or C

13.Which of the following statement is correct? A.Overloaded functions can accept same number of arguments. B. Overloaded functions always return value of same data type. C. Overloaded functions can accept only same number and same type of arguments. D.Overloaded functions can accept only different number and different type of arguments.

14.Which of the following statement is correct? A.The order of the default argument will be right to left. B. The order of the default argument will be left to right. C. The order of the default argument will be alternate. D.The order of the default argument will be random.

15.What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor? A.Compile-time error. B. Preprocessing error. C. Runtime error. D.Runtime exception.

16.For automatic objects, constructors and destructors are called each time the objects A.enter and leave scope B. inherit parent class C. are constructed D.are destroyed 17.Can a class have virtual destructor? A.Yes

B.No

18.A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class. A.constructor B. destructor C. function D.object 19.Which of the following gets called when an object goes out of scope? A.constructor B. destructor C. main D.virtual function

20.Which of the following statement is correct regarding destructor of base class? A.Destructor of base class should always be static. B. Destructor of base class should always be virtual. C. Destructor of base class should not be virtual. D.Destructor of base class should always be private.

You might also like