| 5 | #include <iostream> |
| 6 | using namespace std; |
| 7 | int main8() { |
| 8 | char op; |
| 9 | float num1, num2; |
| 10 | cout << "Enter the 1st operand: "; |
| 11 | cin >> num1; |
| 12 | cout << "Enter operator either + or - or * or / : "; |
| 13 | cin >> op; |
| 14 | cout << "Enter 2nd operand: "; |
| 15 | cin >> num2; |
| 16 | cout << endl; |
| 17 | switch (op) |
| 18 | { |
| 19 | case '+': |
| 20 | cout << "Result is "<< num1 + num2 << endl; |
| 21 | break; |
| 22 | case '-': |
| 23 | cout << "Result is " << num1 - num2 << endl; |
| 24 | break; |
| 25 | case '*': |
| 26 | cout << "Result is " << num1 * num2 << endl; |
| 27 | break; |
| 28 | case '/': |
| 29 | cout << "Result is " << num1 / num2 << endl; |
| 30 | break; |
| 31 | default: |
| 32 | cout << "Error! Operator is not correct"; |
| 33 | break; |
| 34 | } |
| 35 | system("pause"); |
| 36 | return 0; |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected