LakshyaEducation.in

VEDIC MATHS Video Series
  • Home
  • Video Series
    • Vedic Maths Videos
    • Quantitative Aptitude Videos
    • Class 8 Maths Videos
    • Class 9 Maths Videos
    • Class 10 Maths Videos
  • Quiz & Solutions
  • Blog
  • Store
  • Login
  • Contact Us
  • Home
  • Topic
  • C++ Programming
  • Uncaught Exceptions

C++ Programming

UNCAUGHT EXCEPTIONS MCQs

Total Questions : 5

Question 1.

What will not be called when the terminate() is arised in constructor?


  1.    main()
  2.    class
  3.    destructor
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> destructor

None.

Question 2.

What function will be called when we have a uncaught exception?


  1.    catch
  2.    throw
  3.    terminate
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> terminate

If we have an uncaught exception means, compiler will throw the control of program to 

terminate function.

Question 3.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
#include
4.
#include
5.
void Funct()
6.
{
7.
cout
  1.    Integer exception raised.
  2.    Funct() was called by terminate().
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer is Option B. -> Funct() was called by terminate().

As there is no integer in this program, We are printing Funct() was called by terminate().
Output:
$ g++ uce4.cpp
$ a.out
Funct() was called by terminate().

Question 4.


What is the output of this program?



1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
void myterminate ()
6.
{
7.
cerr
  1.    terminate handler called
  2.    Aborted
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> both a & b

In this program, We are using set_terminate to abort the program.
Output:
$ g++ uce2.cpp
$ a.out
terminate handler called
Aborted

Question 5.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
class Test1
4.
{
5.
};
6.
class Test2 : public Test1 { };
7.
void Funct();
8.
int main()
9.
{
10.
try
11.
{
12.
Funct();
13.
}
14.
catch (const Test1&)
15.
{
16.
cerr
  1.    Caught an exception
  2.    NULL
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> Caught an exception

In this program, We are arising the exception by using the method in the class.
Output:
$ g++ uce3.cpp
$ a.out
Caught a exception

  • Share on Facebook!
  • Share on Pinterest!

Sub Topics

  • Abstract Classes
  • Access Control
  • Argument Passing
  • Arrays
  • Booleans
  • C++ Concepts
  • Catching Exceptions
  • Character Types
  • Class Hierarchies And Abstract Classes
  • Class Hierarchies Introduction
  • Classes
  • Comments And Indentation
  • Complex Number Type
  • Constants
  • Constructors And Destructors
  • Container Design
  • Conversion Operators
  • Declaration
  • Default Arguments
  • Dereferencing
  • Derivation And Templates
  • Derived Classes
  • Design Of Class Hierarchies
  • Enumerations
  • Error Handling
  • Error Handling Alternatives
  • Essential Operators
  • Exception Specifications
  • Exceptions
  • Exceptions And Efficiency
  • Exceptions That Are Not Errors
  • Floating Point Types
  • Free Store
  • Friends
  • Function Call
  • Function Declarations
  • Function Templates
  • Functions
  • Grouping Of Exceptions
  • Header Files Usage
  • Increment And Decrement
  • Integer Types
  • Large Objects
  • Linkage
  • Macros
  • Modularization And Interfaces
  • Multiple Inheritance
  • Namespaces
  • Objects
  • Objects And Classes
  • Oops Concepts
  • Operator Functions
  • Operators
  • Overloaded Function Names
  • Pointer To Function
  • Pointer To Void
  • Pointers
  • Pointers Into Arrays
  • Pointers To Members
  • References
  • Resource Management
  • Run Time Type Information
  • Sequence Adapters
  • Sequences
  • Simple String Template
  • Sizes
  • Specialization
  • Standard Exceptions
  • Standard Library Design
  • Statements
  • String Class
  • Structures
  • Subscripting
  • Template Arguments To Specify Policy Usage
  • Types
  • Uncaught Exceptions
  • Unspecified Number Of Arguments
  • User Defined Types
  • Value Return
  • Vector
  • Void

Topics

  • Computer Aptitude
  • SAIL Junior Officer (E-0)
  • 10th Grade
  • 11th Grade
  • 12th Grade
  • 4th Grade
  • 5th Grade
  • 6th Grade
  • 7th Grade
  • 8th Grade
  • 9th Grade
  • NCERT
  • Cat
  • Commerce
  • Computer Science
  • Engineering
  • English
  • General Knowledge
  • Ias
  • Management
  • Quantitative Aptitude
  • Reasoning Aptitude
  • General Studies (Finance And Economics)
  • Analytical Instrumentation
  • Biochemistry
  • Bioinformatics
  • Biology
  • Biotechnology
  • Bitsat
  • Business Statistics
  • C Programming
  • C++ Programming
  • Cell Biology
  • Chemistry
  • Cost Accounting
  • Drug And Pharmaceutical Biotechnology
  • Electrical Measurement And Instrumentation
  • Environment Management
  • Environmental Biotechnology
  • Enzyme Technology
  • Financial Management And Financial Markets
  • Gate
  • General Science
  • Geography
  • Heat Transfer
  • History And National Movements
  • Human Anatomy And Physiology
  • Human And Cultural Diversity
  • Human Resource Management
  • Indian Economy
  • Indian Geography
  • Indian History
  • Indian Polity
  • Instrumentation Transducers
  • International Relations
  • Life Sciences
  • Marketing And Marketing Management
  • Mass Transfer
  • Mechanics Of Materials
  • Microbiology
  • Neet
  • Professional Communication
  • Renewable Energy
  • Sociology
  • Surveying
  • Total Quality Management
  • Uidai Aadhaar Supervisor Certification
  • Virology

Recent Questions

Q.   The Frequency Of Oscillation At Compared To Earth Will Be

Q.   The Formula In Which Σ(x-x̅)² Is Divided By One Less ....

Q.   If....

Q.   What Is The National Sport Of Canada(in Winter And Summer)?

Q.   A Well-oiled Machinery For The Creation And Diffusion Of Fad....

Q.   Considering All 2-digit Natural Numbers, How Many Values Of ....

Q.   In A Gas Welding Of Mild Steel Using An Oxyacetylene Flame, ....

Q.   Which One Of Following Fuels Is Used By Slow Thermal Nuclear....

Q.   Answer The Questions On The Basis Of The Following Informat....

Q.   Who Discovered The Path Of Circulation Of Blood In The Human....

Q.   __________ Is Produced Using Molasses As The Starting Raw Ma....

Q.   &n....

Q.   `3....

Q.   The Ratio Of Mass Concentration Of Species A To The Total M....

Q.   Which Pesticide Killed Many Other Organisms Instead Of Only ....

Q.   Resolution Of A DVM Is Given By ____________

Q.   Who Has Hinted At The Possible Community Transmission Of The....

Q.   The Ability Of Money To Be Moved Easily Is Called:

Q.   EXORBITANT

Q.   An Inventory, Which Consists Of Partially Worked Goods Is Ca....

LakshyaEducation.in
Lakshya Education
Bhilai,Chattisgarh,India
Email: admin@lakshyaeducation.in Phone: 07893519977 (WhatsApp)

Quick Links

  • Vedic Maths
  • Quantitative Aptitude
  • Class – IX Maths
  • Class – X Maths
  • YouTube Channel
  • Maths Fast Trick
  • Blog

Our Services

  • About us
  • Privacy
  • TOS
  • Refund / Cancellation
  • Contact
  • Affiliate Program
  • Copyright © 2022 All Right Reserved | Lakshya Education     ( )
    Login / Register

    Your Account will be created automatically when you click the below Google or Facebook Login Button.
    •   Login With Facebook
    •  Login With Google
     Login With Email/Password