diff --git a/cv3/program.c b/cv3/program.c index 1c5748f..aee9825 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -42,8 +42,10 @@ bool calculatorLogic(char buffer[SIZE][SIZE]){ temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) * atof(buffer[currentlyInBuffer-1]))*100)/100; break; case '/': - if(atof(buffer[currentlyInBuffer-1]) == 0.0) + if(atof(buffer[currentlyInBuffer-1]) == 0.0) { printf("division by zero\n"); + return false; + } else temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) / atof(buffer[currentlyInBuffer-1]))*100)/100; }