C++ Newbie - Basic Calculator Issue
<p>I'm trying to learn some C++, and I decided to build a basic I/O calculator. It runs correctly until the second getUserInput(), then it automatically inputs 0 and terminates. I can't figure out what is happening!</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

int getUserInput() {                                        // Get user numbers
    cout &lt;&lt; "Enter a number: " &lt;&lt; endl;
    int userInputNumber;
    cin &gt;&gt; userInputNumber;
    return userInputNumber;
}

char getUserOper() {                                        // Get user math operator
    cout &lt;&lt; "Enter a math operator: " &lt;&lt; endl;
    int userInputOper;
    cin &gt;&gt; userInputOper;
    return userInputOper;
}

int doMath(int x, char oper, int y) {                       // Does math based on provided operator
    if(oper=='+') {
        return x + y;
    }
    if(oper=='-') {
        return x - y;
    }
    if(oper=='*') {
        return x * y;
    }
    if(oper=='/') {
        return x / y;
    }
    else {
        return 0;
    }
}

void printResult(int endResult) {                           // Prints end result
    cout &lt;&lt; endResult;
}

int main() {
    int userInputOne = getUserInput();
    char userOper = getUserOper();
    int userInputTwo = getUserInput();
    printResult(doMath(userInputOne, userOper, userInputTwo) );
}
</code></pre>
