question archive Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem

Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem

Subject:Computer SciencePrice: Bought3

Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followed by a newline) if the value of userItem does not match any of the defined options. For example, if userItem is GR_APPLES, output should be:

Fruit

#include <stdio.h>

int main(void) {
enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER};

enum GroceryItem userItem = GR_APPLES;

/* Your solution goes here */

return 0;
}

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions