C++ arithmetic on two numbers
Code formatting

Format your code to improve readability and hence maintainability.

DRY (Don't Repeat Yourself) Principle

You have a lot of places with duplicate code. You should try to avoid this.

First of all in your core2 method you have calls in all condition blocks, you should move it below to be executed in any case.

Also you have many duplicate code in your calc methods. You can move duplicate code to your core core2 method.

Inconsistent styles

Use the same style everywhere. If you are starting your sentences for output with uppercase then try to follow it everywhere. The same is true about comments and constructs like to get a sum, to find a product, to divide. Use single ubiquitous style for everything.

Function return types

If you don't want to return anything from your function it should be void. All your calc functions are ints (but you don't call return operator) and you are not using return values. So all your calc functions should be void.

Redundant core2 function

Also core2 function is not needed here, you can use main directly. But C++ specs prohibits this behaviour although this works fine in most compilers. So we can replace core2 recursion with infinite loop in main.



So if we take into account all above notes code will look like this

#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

// Now we have only primitive one-liner arithmetic functions
// with double return types    

double add(double a, double b) { return a + b; }

double subtract(double a, double b) { return a / b; }

double multiply(double a, double b) { return a * b; }

double divide(double a, double b) { return a / b; }

void core2() {
    string choice;
    cout &lt;&lt; "Would you like to multiply, divide, add, or subtract? (typer in lowercase)" &lt;&lt; endl;
    cin &gt;&gt; choice;

    // Choosing correct action name to output
    string result_name;

    if (choice == "add") {
        result_name = "sum";
    } else if (choice == "subtract") {
        result_name = "difference";
    } else if (choice == "multiply") {
        result_name = "product";
    } else if (choice == "divide") {
        result_name = "quotient";
    } else { // This block also performs validation of input parameter
        result_name = ""; // Just to prevent compiler error due to undeclared variable
        cout &lt;&lt; "USER ERROR" &lt;&lt; endl &lt;&lt; "you typed in something wrong, try again." &lt;&lt; endl;
        return; // end execution here
    }

    // Entering numbers in single place
    double a;
    double b;
    cout &lt;&lt; "Enter two numbers to get the "&lt;&lt; result_name &lt;&lt; "." &lt;&lt; endl;
    cin &gt;&gt; a &gt;&gt; b;

    double result;

    if (choice == "add") {
        result = add(a, b);
    } else if (choice == "subtract") {
        result = subtract(a, b);
    } else if (choice == "multiply") {
        result = subtract(a, b);
    } else {
        result = divide(a, b);
    }

    // Outputting result in single place
    cout &lt;&lt; "The " &lt;&lt; result_name &lt;&lt; " is " &lt;&lt; result &lt;&lt; "." &lt;&lt; endl;
}

int main() {
    while (true) {
        core2();
    }
}




Further improvement will use more advanced techniques and relatively new C++11 features.

You need some way to map string and function, so for this we will use std::map as dictionary and std::function as polymorphic function wrapper. Also lambdas will be use to pass anonymous functions here as parameters. struct will be here used as container to store calculation function and result description.

#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;functional&gt;
#include &lt;map&gt;
using namespace std;

struct CalculationTechnique {
    std::function&lt;double (double,double)&gt; Function;
    string ResultName;
};

void core2() {
    string choice;
    cout &lt;&lt; "Would you like to multiply, divide, add, or subtract? (typer in lowercase)" &lt;&lt; endl;
    cin &gt;&gt; choice;

    // Filling our dictionary
    std::map&lt;string, CalculationTechnique&gt; calculation_mapping = {
        { "add", CalculationTechnique { [](double a, double b) -&gt; double { return a + b; }, "sum" } },
        { "subtract", CalculationTechnique { [](double a, double b) -&gt; double { return a - b; }, "difference" } },
        { "multiply", CalculationTechnique { [](double a, double b) -&gt; double { return a * b; }, "product" } },
        { "divide", CalculationTechnique { [](double a, double b) -&gt; double { return a / b; }, "quotient" } }
    };    

    // if no value found in dictionary
    if (calculation_mapping.count(choice) == 0) {
        cout &lt;&lt; "USER ERROR" &lt;&lt; endl &lt;&lt; "you typed in something wrong, try again." &lt;&lt; endl;
        return;
    }

    CalculationTechnique technique = calculation_mapping.at(choice);

    double a;
    double b;
    cout &lt;&lt; "Enter two numbers to get the "&lt;&lt; technique.ResultName &lt;&lt; "." &lt;&lt; endl;
    cin &gt;&gt; a &gt;&gt; b;

    cout &lt;&lt; "The " &lt;&lt; technique.ResultName &lt;&lt; " is " &lt;&lt; technique.Function(a, b) &lt;&lt; "." &lt;&lt; endl;
}

int main() {
    while (true) {
        core2();
    }
}