Classical

Object Oriented Programming - Functions

1:  

Choose the correct statements regarding inline functions.   

A.

It speeds up execution

B.

It slows down execution

C.

It increases the code size

D.

Both (a) and (c)

 
 

Option: D

Explanation :

Each occurrence of the iriline function call wiIl be replaced by its body. No function call overhead will be there but the size of the code will increase.


2:  

If many functions-have the same name, which of the following information, if present, will be used by the compiler to invoke the correct function to be used?    

A.

The operator  : :

B.

The return value of the function

C.

Function signature

D.

Both (a) & (c)

 
 

Option: D

Explanation :


3:  

A function abc is defined as
void abc(int x=0, int y, int z=0)
{

cout << x  << y << z;
}

Which of the following function calls is/are illegal? (Assume h, g are declared as integers)     

A.

abc () ;

B.

abc (h) ;

C.

abc (h, h) ;

D.

Both (a) & (b)

 
 

Option: D

Explanation :

Since the second argument is mandatory, any call should have at least the first two parameters. Some compilers expect the optional parameters to follow the others. Such compilers give a compilation error.


4:  

The compiler identifies a virtual function to be pure  

A.

by the presence of the keyword pure

B.

by its location in the program

C.

if it is equated to 0

D.

none of the above

 
 

Option: C

Explanation :


5:  

int a =1 , b=2;

a=chg(b) ;

cout << a << b ;

If the function chg is coded as


int chg(int x)
{
x = 10;

return ();

}
then    

A.

it results in compile-time error

B.

it results in run time error

C.

it prints 112

D.

it prints 111 

 
 

Option: C

Explanation :

Here the default parameter passing mechanism of pass by value will be used. Any change done to the parameter will not be reflected outside the function. So, b retains its value 2.




Suggest an improvement

 


Syllabus covered in this section is-

  • O-O Programming Concepts , Class object instantiation
  • Inheritance, polymorphism and overloading
  • C++ Prograinming - Elements of C++, Tokens,
  • Identifters Variables and constants, data, types
  • Operators, Control, statements
  • Functions
  • Parameter passing
  • Class and objects
  •  Constructors and destructors
  •  Overloading,  Inheritance,
  • Templates, Exception handling

This Section covers OOPS Questions Answers .These questions can be used for the preparation of various competitive and academic exams like

  • UGC NET Computer Science
  • Pre PhD Entrance Exam
  • DOEACC Exams
  • Kendriya Vidyalaya Sangathan Entrance Test
  • Undergraduate Computer Science  Course
  • GATE Computer Science
  • Post Graduate Computer Science Exam
  •  PhD Entrance Exam
  • Computer Engineering

Who can benefit

  • Object Oriented Programming Questions Answers can be used by any student who is preparing for PhD entrance exam, pre PhD entrance exam, entrance exam  or any other such exam.
  • Any student who is preparing for DOEACC exams can also use OOPS questions answers for preparation of his exams.
  • OOPS mcq can be useful for the students who are pursuing any undergraduate or post graduate degree in computer science like BE, ME , Btech, Mtech, .BSc, MSc, BCA, MCA, BS, MS  or any other such degree
  • OOPS mcq with answers and explanation can also be useful for the students who are preparing for any competitive exam or recruitment exams like GATE Computer Science, UGC NET Computer Science, Kendriya Vidyalaya Sangathan PGT exam, PSU, IES or any other such exam.
  • OOPS multiple choice questions answers  can also be used by any candidate who wants to gain credits in OOPS in BS Computer science or MS Computer science,
  • You can download OOPS mcq pdf from this site.
  • You can get access to OOPS multiple choice questions answers EBook.

Various Search Terms Used For This Section Are

  • OOPS Quiz Questions With Answers

  • OOPS Exam Questions Answers

  • OOPS Mcq Questions Answers

  • OOPS Mcq Pdf Download

  • C++ Questions Answers

  • C++ Programming Questions Answers