Classical

Object Oriented Programming - Find Output

6:  

The following program segment
const int m = 10 ;
int &n = m ;
n = l1 ;
cout << m << n;      

A.

results in compile time error

B.

results in run time error

C.

prints 1111

D.

prints 1 0 11

 
 

Option: A

Explanation :


7:  

The following program segment
int a = 10 ;
int const &b = a ;
a = l1 ;
cout << a <<  b ;      

A.

results in compile time error

B.

results in run time error

C.

prints 1111

D.

none of the above

 
 

Option: C

Explanation :

The very idea of declaring b as a constant integer is to protect it from changes. However, since it is aliased to a variable whose attribute is not const, the value of b can be indirectly changed by changing the value of a. This is a bad programming practice.


8:  

Which of the following is not a storage class supported by C++ ?     

A.

register

B.

auto

C.

mutable

D.

dynamic

 
 

Option: D

Explanation :


9:  

Consider the following program segment.
static char X [3] = "1234" ;
cout <<  X ;

A complete c++ program with these two statements     

A.

prints 12 3 4

B.

prints 12 3

C.

prints 1234 followed by some junk

D.

will give a compilation error

 
 

Option: D

Explanation :

c++ forbids initialization with strings, whose length is more than the size of the array. C compiler permits.


10:  

Consider the following program segment.
const char *p1= "To make the bitter butter better"  ;              // stm1
char *const p2 = "Recommend this book 2 others ";          //stm2
p1 = "add some better butter not bitter. " ;                              //stm3
p2 = "so that th~y 2 will get benefited. " ;                               //stm4
* (p1+3) = 'A' ;                                                                                 //stm5
* (p2+3) = 'A' ;                                                                               //stm6


Which of the statement results in error?      

A.

stm4 and stm5

B.

stm1 and stm2

C.

stm1 and stm4

D.

stm2 and stm3

 
 

Option: A

Explanation :




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