Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

What is the output of the program if character 2 is supplied as input?

What is the output of the program if character 2 is supplied as input?

#include

using namespace std;

int main () {

int c;

cin >> c;

try

{

switch (c)

{

case 1:

throw 20;

case 2:

throw 5.2f;

}

}

catch (int e)

{ cout << "int exception. Exception Nr. " << e; }

catch (float e)

{ cout << "float exception. Exception Nr. " << e; }

catch (...)

{ cout << "An exception occurred."; }

return 0;

}

A.

It prints: float exception. Exception Nr.

B.

It prints: int exception. Exception Nr. 20

C.

It prints: An exception occurred

D.

It prints: float exception. Exception Nr. 5.2

C++ Institute CPA-21-02 Summary

  • Vendor: C++ Institute
  • Product: CPA-21-02
  • Update on: Aug 2, 2025
  • Questions: 257
Price: $52.5  $149.99
Buy Now CPA-21-02 PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method