2 Show the output of the following code segment 3 points cha

2) Show the output of the following code segment: (3 points) char Grade \'F\'; switch Grade case \'A\' print f \"Excellent In\" break case \'B\' printf \"Good n\" break; case \'C\' print f \"OK n\" break; case D\' printf \"satisfactory\ \" break; case \'F\' printf \"Failure n\" break; default printf \"What is your grade anyway? n\" break;

Solution

if(Grade==\'A\') {
   printf(\"Excellent\ \");
}
else if(Grade==\'B\') {
   printf(\"Good\ \");
}
else if(Grade==\'C\') {
   printf(\"OK\ \");
}
else if(Grade==\'D\') {
   printf(\"Satisfactory\ \");
}
else if(Grade==\'E\') {
   printf(\"Failure\ \");
}
else {
   printf(\"What is your grade anyway?\ \");
}

 2) Show the output of the following code segment: (3 points) char Grade \'F\'; switch Grade case \'A\' print f \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site