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;}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:
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;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here