Question: For the following code with an enumerated type, enum fruit _ tag { BLUEBERRY, BANANA, PINEAPPLE, WATERMELON } ; typedef enum fruit _ tag fruit
For the following code with an enumerated type,
enum fruittag
BLUEBERRY,
BANANA,
PINEAPPLE,
WATERMELON
;
typedef enum fruittag fruitt;
void printFruit fruitt myFruit
switchmyFruit
case BLUEBERRY:
printfa blueberry";
break;
case BANANA:
printfa banana";
break;
case PINEAPPLE:
printfa pineapple";
break;
Case WATERMELON:
printfa watermelon";
break;
void comparefruitfruitt fruit fruitt fruit
if fruit fruit
printFruitfruit;
printf is larger than ;
printFruitfruit;
else
printFruitfruit;
printf is smaller than ;
printFruitfruit;
int mainvoid
fruitt myFruit PINEAPPLE ; fruitt otherFruit BLUEBERRY; compareFruit myFruit otherFruit; Return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
