Program Help

I am trying to make a program that reads in a text file with a math operation on each line. It will then calculate the answer and display the numbers with the result on the screen. When I execute, the code just goes on forever repeating addition(thats the math operation on the first line) and 0's for the numbers and answer(even though that shoudlnt be the case). Can someone help me where I went wrong? An eplaination for why would be greatly appreciated too.
Thanks in advance

//This while loop tells the program to keep the file open if there is another
// character to be read
while(inFile)
{
//This branches off into different math operations that will be done
//depending on what character is read
switch(ch)
{
case '+':doAddition(num1, num2);
break;
case '-':doSubtraction(num1, num2);
break;
case '*':doMultiplication(num1, num2);
break;
case '^':doExponent(num1, num2);
break;
case '/':doDivision(num1, num2);
break;
case '!':doFactorial(num1);
break;
default:inFile.ignore(100, '\n' );
break;

One other point. There are a lot of global variables:int num1, num2, tempNum, result, leftOver;
These should instead be defined locally within whichever function will use them. For example num1 and num2 should be defined inside function main()