C++

 

Question No

Questions

Answer options

1

Which of the following is a valid identifier?

 

 

a. Stu-class

 b.  _Bank

 c. 4emp

d.   break

 

 

2

A continue statement causes execution to skip to __________.

 

 

a. The return 0; statement     

  b. The first statement after the loop     

c. The statement following the continue statement     

d.   The next iteration of the loop

3

Friend functions have access to the _________ member/members of a class.

 

 

a. private

b. public

c. public and protected

d. private and protected

 

 

4

______ is a function call mechanism that passes arguments to a function by passing the addresses of the arguments

 

 

a. Macro

b. Inline function

c. Call by Reference

d. Call by Value

5

__________ is an argument value that is specified in a function declaration and is used if the corresponding actual argument is omitted when the function is called.

 

a.    Default

b.    Formal

c.    Actual

d.    Main

 

6

When a language has the capability to produce new data types, it is said to be _________.

 

a.    Reprehensible

b.    Encapsulated

c.    Overloaded

d.   Extensible

 

7

A static automatic variable is used to

a.    Make a variable visible to several functions

b.    Make a variable visible to calling function

c.    Conserve memory when a function is not executing

d.   Retain a value when a function is not executing

 

8

When you overload an arithmetic assignment operator, the result is

a.    Goes in the object to the right of the operator

b.    Goes in the object to the left of the operator

c.    Goes in the object of which the operator is a member

d.    Must be returned

 

9

Which of the following statements are correct to delete a dynamic object from a pointer p?

a.    delete *p;

b.    delete p;

c.    delete [] *p;

d.    delete [] p;

 

10

What is the use of int isgraph (int ) function

a.    It is a combination of isalpha and isgraph function

b.    It is a combination of isalpha and isdigit function

c.    It is a combination of isalpha, isdigit and isgraph function

d.    none of the above