Which keyword is used to catch exceptions in C++? 

  • handle 
  • rescue 
  • catch 
  • secure
In C++, the catch keyword is used to define a block of statements that will be executed when a particular exception is thrown. This block is used to handle the exception and provide a response, ensuring that the program can continue or terminate gracefully.

In C++, an abstract class can have a mix of abstract as well as _______ methods. 

  • concrete 
  • private 
  • static 
  • virtual
An abstract class in C++ can have both abstract methods (methods without any definition) and concrete methods (methods with a definition). This allows for a mix of defined and undefined behaviors in subclasses.

Which type of class inheritance allows a derived class to inherit attributes and methods from more than one base class? 

  • Single 
  • Multilevel 
  • Multiple 
  • Hierarchical
Multiple inheritance in C++ allows a derived class to inherit attributes and methods from more than one base class. This contrasts with single inheritance where a class can inherit only from one superclass. C++ supports multiple inheritance, unlike some other OO languages.

In a situation where multiple if conditions are true, the _______ block will be executed in C++. 

  • first 
  • last 
  • second 
  • all
In C++, when multiple 'if' conditions are true, only the block corresponding to the first true condition will be executed. Subsequent true conditions are ignored.

Which of the following scenarios is the most suitable for using a break statement in a professional codebase? 

  • When you want to exit the program. 
  • When you want to initialize variables. 
  • To exit a loop when a certain condition becomes true. 
  • To increase the performance of loops.
The break statement is primarily used for exiting a loop or a switch when a specific condition is met. In a professional codebase, it's particularly useful for scenarios where processing should not continue once a certain condition has been satisfied, ensuring efficient and intended behavior.