Answer:
Required code is given below.
Best Regards,
Please ask if any queries.
Explanation:
#include <stdio.h>
#include <string.h>
int main(void)
{
char input[100];
printf("Enter desired auto service:\n");
scanf ("%[^\n]%*c", input);
printf("You entered: %s\n",input);
if(strcmp(input,"Oil change") == 0){
printf("Cost of oil change: $35\n");
}
else if(strcmp(input,"Tire rotation") == 0){
printf("Cost of tire rotation: $19\n");
}
else if(strcmp(input,"Car wash") == 0){
printf("Cost of car wash: $7\n");
}
else{
printf("Error: Requested service is not recognized\n");
}
return 0;
}