-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
36 lines (30 loc) · 802 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// main.cpp
#include <iostream>
#include "function.h"
using namespace std;
int main() {
double a, b;
char operation;
cout << "Enter two numbers: ";
cin >> a >> b;
cout << "Choose operation (+, -, *, /): ";
cin >> operation;
switch (operation) {
case '+':
cout << "Result: " << Function::add(a, b) << endl;
break;
case '-':
cout << "Result: " << Function::subtract(a, b) << endl;
break;
case '*':
cout << "Result: " << Function::multiply(a, b) << endl;
break;
case '/':
cout << "Result: " << Function::divide(a, b) << endl;
break;
default:
cout << "Incorrect operation!" << endl;
break;
}
return 0;
}