What happens if character 3 is entered as input?

What happens if character 3 is entered as input?
#include using namespace std; class A { public: int i;
}; int main () { int c; A obj; obj.i = 5; cin >> c; try { switch (c)
{
case A. throw 20;
case B. throw 5.2f;
case C. throw obj;
default: cout<<"No exception"; } } catch (int e) { cout << "int exception. Exception Nr. " << e; } catch (A e) { cout << "object exception. Exception Nr. " << e.i; } catch (...) { cout << "An exception occurred."; } return 0; } A. It prints: object exception. Exception Nr. 5
B. It prints: int exception. Exception Nr.
C. It prints: An exception occurred
D. It prints: No exception

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.