develop a c++ program to implement simple calculator code example
Example: how to build a calculator using c++
#include <iostream>
using namespace std;
int main()
{
int num1;
int num2;
char op;
cout << "Enter a number:" << endl;
cin >> num1;
cout << "Enter another number:" << endl;
cin >> num2;
cout << "Enter a operator:" << endl;
cin >> op;
if(op == '+')
{
cout << "Result = " << num1 + num2 << endl;
}else if(op == '-'){
cout << "Result = " << num1 - num2 << endl;
}else if(op == '*'){
cout << "Result = " << num1 * num2 << endl;
}else if(op == '/'){
cout << "Result = " << num1 / num2 << endl;
}
}