Please edit my code thankyou to the given picture #include int main() { char ch; double firstN, secondN; printf("Enter an choice (+, -, *, /): "); scanf("%c", &ch); printf("Enter two numbers: ");...


Please edit my code thankyou to the given picture


#include
int main() {
  char ch;
  double firstN, secondN;
  printf("Enter an choice (+, -, *, /): ");
  scanf("%c", &ch);
  printf("Enter two numbers: ");
  scanf("%lf %lf", &firstN, &secondN);


  switch (ch) {
    case '+':
      printf("The addition of %.1lf and %.1lf is %.1lf", firstN, secondN, firstN + secondN);
      break;
    case '-':
      printf("The Subtraction of %.1lf anf %.1lf is %.1lf", firstN, secondN, firstN - secondN);
      break;
    case '*':
      printf("The multipication of %.1lf * %.1lf is %.1lf", firstN, secondN, firstN * secondN);
      break;
    case '/':
      printf("The division of %.1lf and %.1lf is %.1lf", firstN, secondN, firstN / secondN);
      break;

    default:
      printf("Invalid input");
  }


  return 0;
}


Create a program that will ask user to input two numbers and choose from the four<br>mathematical operations and display the answer. (use nested if or switch statement)<br>Here is your sample screen output:<br>Input First Number:<br>Input Second Number:<br>Choose Arithmetic Operations<br>1. ADD<br>2. SUBTRACT<br>3. MULTIPLY<br>4. DIVIDE<br>5. Exit<br>Select Operation (1-5): _<br>The SUM of the two numbers is:<br>

Extracted text: Create a program that will ask user to input two numbers and choose from the four mathematical operations and display the answer. (use nested if or switch statement) Here is your sample screen output: Input First Number: Input Second Number: Choose Arithmetic Operations 1. ADD 2. SUBTRACT 3. MULTIPLY 4. DIVIDE 5. Exit Select Operation (1-5): _ The SUM of the two numbers is:

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here