Hello all! Just started taking an evening course in C (brand new to programming)and am enjoying it immensely. I am however having a couple of problems with understanding what I know are pretty basic situations. Can someone tell me why my program compiles but then when I try to execute it it gives a windows error and crash's. It is supposed to emulate a simple calculator reading from a disk file and writing to another with errror messages if you try to divide by 0 or use an unknown operator. Any advice is appreciated and the input file is in the directory with the .c and .in files.

#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
{
// Read x op y from infile
fscanf(infile, "%d %c %d", &x, &op, &y);
answer = (x + y) || (x - y) || (x * y) || (x / y);
if (op != ('+' || '-' || '*' || '/'))
fprintf(outfile,"\n Unknown Operator!");
else
if (y == 0)
fprintf(outfile,"\n Division by Zero is not allowed!");
else
fprintf(outfile,"\n%d %c %d = %d", x, op, y,answer);





}while (!((x == 0) && (y == 0)));

return 0;
}