C program to design calculator with basic operations using switch
This program will read two integer numbers and an operator like +,-,*,/,% and then print the result according to given operator, it is a complete calculator program on basic arithmetic operators using switch statement in c programming language.
Calculator program with Basic operations using switch
Output
First run: Enter first number: 10 Enter second number: 20 Choose operation to perform (+,-,*,/,%): + Result: 10 + 20 = 30.000000 Second run: Enter first number: 10 Enter second number: 3 Choose operation to perform (+,-,*,/,%): / Result: 10 / 3 = 3.333333 Third run: Enter first number: 10 Enter second number: 3 Choose operation to perform (+,-,*,/,%): > Invalid operation. Result: 10 > 3 = 0.000000need an explanation for this answer? contact us directly to get an explanation for this answer