Question: Convert the following C code into bash shell program. Do not use if. #include int main () { /* local variable definition */ char grade

Convert the following C code into bash shell program. Do not use if.

#include

int main () {

/* local variable definition */

char grade = 'B';

switch(grade) {

case 'A' :

printf("Excellent! " );

break;

case 'B' :

case 'C' :

printf("Well done " );

break;

case 'D' :

printf("You passed " );

break;

case 'F' :

printf("Better try again " );

break;

default :

printf("Invalid grade " );

}

printf("Your grade is %c ", grade );

return 0;

}

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!