Functions
1.

Which is not a proper prototype ?

A.  

int funct(char x, char y);

B.  

double funct(char x)

C.  

void funct();

D.  

char x();

2.

 What is the return type of the function with prototype:"int func(char x, float v, double t);"

A.  

char

B.  

int

C.  

float

D.  

double 

3.

 What is the return type of the function with prototype:"int func(char x, float v, double t);"

A.  

char

B.  

int

C.  

float

D.  

double 

4.

 Which of the following is a valid function call (assuming the function exists) ?

A.  

funct;

B.  

funct x, y;

C.  

funct();

D.  

int funct();

5.

Which of the following is a complete function ?

A.  

int funct();

B.  

int funct(int x) {return x=x+1;}

C.  

void funct(int) {cout&tl;<"Hello"}

D.  

void funct(x) {cout<<"Hello"}

6.

Which of the following function / types of function cannot have default parameters ?

A.  

Member function of class

B.  

Main()

C.  

Member function of structure

D.  

Both B and C

7.

Correct way to declare pure virtual function in a C++ class is

A.  

Virtual void foo() =0 ;

B.  

Void virtual foo()= { 0 }

C.  

Virtual void foo() {} = 0;

D.  

None of the above

8.

What is the scope of the variable declared in the user defined function ?

A.  

Whole program

B.  

Only inside the {} block

C.  

The main function

D.  

None of the above

9.

Which of the following in Object Oriented Programming is supported by Function overloading and default arguments features of C++.

A.  

Inheritance

B.  

Polymorphism

C.  

Encapsulation

D.  

None of these

10.

Which of the following statement is correct ?

A.  

Only one parameter of a function can be a default parameter.

B.  

Minimum one parameter of a function must be a default parameter.

C.  

All the parameters of a function can be default parameters.

D.  

No parameter of a function can be default.