- int main()
- {
- ...
- while (endJob == 0)
- {
- Div0 = 0;
- endCLine = 0;
- accumulator = DECI();
- while (endCLine == 0)
- {
- operator = getchar();
- if ((operator == '=') || (operator == 'q')) { if (Div0) {printf("Div/0\n");}
- else {DECO(accumulator); putchar('\n');};
- endCLine = 1;
- if (operator == 'q') endJob = 1;}
- else {
- operand = DECI();
- accumulator = operate(accumulator,operator,operand);
- };
- }; /* end Command Line loop */
- }; /* end Job loop */
- }
Raw Paste