Question: Rewrite the following if-else chain using a switch statement If (lettergrade=='A') printf(The numerical grade is between 90 and 100 ); else if((lettergrade=='B') printf(The numerical grade
If (lettergrade=='A')
printf("The numerical grade is between 90 and 100\n");
else if((lettergrade=='B')
printf("The numerical grade is between 80 and 89.9\n");
else if(lettergrade=='C')
printf("The numerical grade is between 70 and 70.9\n");
else if(lettergrade=='D')
printf(" How are you going to explain this one\n");
else
{
printf("of course I had nothing to do with my grade\n");
pringf("The teacher was really off the wall\n")
}
Step by Step Solution
3.40 Rating (175 Votes )
There are 3 Steps involved in it
switchlettergrade case A printfThe numerical grade is between 90 and 100 b... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
1019-B-C-A-T-A(2011).docx
120 KBs Word File
