write a program that asks a user an integer, prompt a menu that says: a=addition b=subtraction c=multiplication d=division and return the given option.
Code: #include <stdio.h> //not exactly what you asked but will help ya int main (void) { float value1, value2; char operator; printf("Type in your expression.\n"); scanf("%f %c %f", &value1, &operator, &value2); switch (operator) { case '+': printf ("%.2f\n", value1 + value2); break; case '-': printf ("%.2f\n", value1 - value2); break; case '*': printf ("%.2f\n", value1 * value2); break; case '/': if ( value2 == 0 ) printf ("Division by zero.\n"); else printf ("%.2f\n", value1 / value2); break; default: printf ("Unknown operator.\n"); break; } return 0; }