- /* 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);
Raw Paste