Programming Language C++ MCQ SET-4

C++ Progamming Language MCQs Questions and Answers | SET-4

Important C++ Progamming Language Solved Questions and Answers

Welcome to our exclusive collections of C++ Progamming Language (MCQ) Questions and with answers. Important C++ Progamming Language online MCQs practice test sets questions with answers for interviews, competitive exams. These multiple choice questions(MCQs) on C++ Progamming Language are suitable for both aspirant freshers and experienced who are preparing for competitive exam. In these MCQs sets we are going to share most important questions related to C++ Progamming Language. These questions are very helpful for those candidates ans aspirants who are preparing for the various government and non government exam as well as in interview.

C++ Progamming Language MCQs Questions and Answers | SET-4


Question 31-40

Question : 31

How many times AEM.com is printed here?
int main() { for(int i=0; i< 5; i++); cout<<"AEM.com";

[A].   0
[B].   1
[C].   4
[D].   5


Question : 32

Can a for loop contain another for loop?

[A].   No
[B].   Yes
[C].   Compilation Error
[D].   Runtime Error


Question : 33

To perform File I/O operations, we must use _____________ header file.

[A].   < ifstream>
[B].   < ofstream>
[C].   < fstream>
[D].   Any of these


Question : 34

Find output of below program
int main() { int c1,c2; int a = -8; int b = 3; c1 = --a + b; c2 = a-- + b; cout<<"c1="<<c1<<", "<<"c2="<<c2<<endl;

[A].   c1=-7,c2=-4
[B].   c1=-7,c2=-3
[C].   c1=-4,c1=b-3
[D].   c1=-6,c2=-6


Question : 35

If default constructor is not defined, then how the objects of the class will be created?

[A].   The compiler will generate error
[B].   Error will occur at run-time.
[C].   Compiler provides its default constructor to build the object.
[D].   None of these


Question : 36

Which Exception is thrown when new fails to allocate memory?

[A].   std::exception
[B].   std::bad_alloc
[C].   std::runtime_error
[D].   std::out_of_range


Question : 37

Which of the followings is/are not a manipulator/s ?

1. flush
2. base
3. ends
4. oct
5. bin
6. skipws

[A].   Only 1, 6
[B].   Only 1,4,6
[C].   Only 1,3,6
[D].   Only 2,5


Question : 38

An exception is thrown using _____________ keyword in CPP.

[A].   throws
[B].   throw
[C].   threw
[D].   Thrown


Question : 39

Which exception is thrown when dynamic_cast fails?

[A].   std::bad_typeid
[B].   std::logic_error
[C].   std::runtime_error
[D].   std::bad_cast


Question : 40

When Virtual Table is created?

[A].   Every Class has VTable
[B].   Class inherited from other Class
[C].   When a Class Overrides the function of Base class
[D].   Class has atleast one Virtual Function





To Read Next Set
Click on below links



Please Read These Useful Post Also
कृपया इन्हें भी पढ़ें


MCQs Practice Sets for Sure Success in all competitive exams



If you are planning to qualify teacher eligibility test, TET, CTET, all India state TET, JEE Main, NEET UG, AIPMT, AIIMS, AFMC, DPMT, BHU, IP MBBS, JIPMER, State PMT, MHT , you can practice these question papers online. We have taken all the necessary care to provide you with genuine question papers and the answers from reliable sources. Hope our labors server student’s community in better way.

Visit  http://examsuccessmaster.blogspot.com/  for a complete list of exam quizzes e.g. Child development, Psychlogy, Inclusive Education, Social Studies, physics || general science MCQ, Himachal pradesh Gk, chemistry, physics, Mathematics, math, General science, computer basics, old question papers, environmental studies,Geography, Polity Social Issue, Social Science complete study material,aptitude tests, Practice sets,HPTET,Engineering Interview, Civil Engineering, Mechanical Engineering, Electrical Engineering, most frequently asked,tests,HPTET Questions and Answers, Engineering Multiple choice, MCQ Questions on various subjects and topics and much more.

No comments:

Post a Comment