Question: The output printed after executing the following C++ code is 15. int ex=95, ct ; switch (ex % 16) { case 0 : case 1

The output printed after executing the following C++ code is 15.
int ex=95, ct ;
switch (ex % 16)
{
case 0 : case 1 :case 2 :case 3: cout << 2*(ex/16) << endl ; break;
case 4 : case 5 :case 6 :case 7: cout << 2*(ex/10) << endl ; break;
case 8 : case 9 :case 10 :case 11: cout << 2*(ex%10) << endl ; break;
case 12 : case 13 :case 14 :case 15: cout << 3*(ex/16) << endl ; break;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!