Thanks guys!
I finally got it. You were both right about the 8x7 not being 8*7 of course and all your help was useful and appreciated. I am on to another set of exersizes now so I may have to enlist your help and expertise again. I thought I would include my code so you can see how I managed to do it. Thanks again!
Code:
#include <stdio.h>
int main()
{
FILE* infile;
FILE* outfile;
int x, y, answer;
char op;
infile = fopen("calc4.in", "r");
outfile = fopen("calc4.out", "w");
do
{
fscanf(infile, "%d %c %d", &x, &op, &y);
/* check for division by 0 */
if ((y == 0) && (op == '/'))
fprintf(outfile, "\nDivision by zero not allowed!");
/*check for legal operator */
else if (op == '+'){
answer = x + y;
fprintf(outfile, "\n%d%c%d = %d", x, op, y, answer);
} else if (op == '-'){
answer = x - y;
fprintf(outfile, "\n%d%c%d = %d", x, op, y, answer);
} else if (op == '*'){
answer = x * y;
fprintf(outfile, "\n%d%c%d = %d", x, op, y, answer);
} else if (op == '/'){
answer = x / y;
fprintf(outfile, "\n%d%c%d = %d", x, op, y, answer);
}
/* check for illegal operator */
else
fprintf(outfile, "\nIllegal Operator!");
}
while (!((x == 0) && (y == 0)));
fclose(infile);
fclose(outfile);
return 0;
}