Object Oriented Programming - Find Output

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

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

  • 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.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

A complete c++ program with these two statements 

  • Option : D
  • Explanation : c++ forbids initialization with strings, whose length is more than the size of the array. C compiler permits.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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? 

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


  • Find Output Questions can be used to give quizzes by any candidate who is preparing for UGC NET Computer Science
  • This Find Output Questions section will help you test your analytical skills in a tricky method, thereby giving you an edge over other students
  • Any student who wants to prepare for DOEACC A Level, DOEACC B Level, and DOEACC C level can also use these Objective Type Questions Answer.
  • All candidates who have to appear for the Kendriya Vidyalaya Entrance exam can also refer to this mcq section.
  • You can also get access to the Find Output MCQ ebook.
  • Find Output Questions can be used in the preparation of JRF, CSIR, and various other exams.
  • You can also download pdf for these Find Output multiple-choice questions Answers.
  • This Find Output Multiple Choice Questions Answers section can also be used for the preparation of various competitive exams like UGC NET, GATE, PSU, IES, and many more.
  • Find Output Questions can be used to gain a credit score in various undergraduate and postgraduate courses like BSc, MSc and MCA
  • Find Output Questions for UGC NET Computer Science

    Find Output MCQ

    Find Output Multiple choice questions