This program runs perfect just want to know if I have to do this arithmetic operations using functions how can I do that?
// Arithmetic.cpp - This program performs arithmetic, ( +. -, *. / ) on two numbers.
// Input: Interactive
// Output: Result of arithmetic operation
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
double numberOne, numberTwo;
string operation;
double result;
cout << "Enter the first number: ";
cin >> numberOne;
cout << "Enter the second number: ";
cin >> numberTwo;
cout << "Enter an operator (+.-.*,/): ";
cin >> operation;
if (operation == "+")
{
result = numberOne + numberTwo;
}
else if (operation == "-")
{
result = numberOne - numberTwo;
}
else if (operation == "*")
{
result = numberOne * numberTwo;
}
else if (operation == "/")
{
result = numberOne / numberTwo;
}
cout << numberOne;
cout << " " << operation << " ";
cout << numberTwo;
cout << " = ";
cout << result << endl;
system("PAUSE");
return EXIT_SUCCESS;
} // End of main() function