so im trying to prevent a division by zero error with an if statement, and im wondering if i can use one if statement or if i need two.
im doing a gas mileage calculator, i have got everything done up to the calculation. what im wondering is if i can doing something like this or not:
if (totalmilescounter != 0, totalgallonscounter != 0)
//calulate gas mileage
MPG = totalmilescounter / gallonscounter;
} //end if