C
24
operate on accumulator
Guest on 27th April 2022 01:33:48 AM
/* operate on accumulator */
int operate(int accumulator, int operator, int operand)
{
if (Div0 == 0) {if (operator == '+' ) {accumulator += operand;}
else if (operator == '-') {accumulator -= operand;}
else if (operator == '*') { accumulator = imult(accumulator,operand);}
else if (operator == '/') { accumulator = idiv(accumulator,operand);}
else if (operator == '%') { accumulator = imod(accumulator,operand);}
else {printf("Erreur d'opérateur!\n"n"
);
endCLine = 1;
endJob = 1;};
};
return(accumulator);