#include<-iostream->
#include<-cmath->
using namespace std;
int main() {
cout << "Welcome to the simple calculator!" << endl;
cout << "Please enter your first number: ";
int num1;
cin >> num1;
cout << "Please enter your second number: ";
int num2;
cin >> num2;
cout << "Please enter the operation you would like to perform (+, -, *, /): ";
char operation;
cin >> operation;
if (operation == '+') {
cout << "The result is: " << num1 + num2 << endl;
} else if (operation == '-') {
cout << "The result is: " << num1 - num2 << endl;
} else if (operation == '*') {
cout << "The result is: " << num1 * num2 << endl;
} else if (operation == '/') {
cout << "The result is: " << num1 / num2 << endl;
} else {
cout << "Invalid operation" << endl;
}
return 0;
}
How to make calculator in C++
This is simple calculator in C++ for beginner programmer
Please remove this sign '-' from first two lines.
.png)