C   29
accumulator deci
Guest on 17th September 2023 09:31:10 PM


  1. int main()
  2. {
  3. ...    
  4.         while (endJob == 0)
  5.         {
  6.                 Div0 = 0;
  7.                 endCLine = 0;
  8.                
  9.                 accumulator = DECI();
  10.                
  11.                 while (endCLine == 0)
  12.                 {
  13.                         operator = getchar();
  14.                         if ((operator == '=') || (operator == 'q')) { if (Div0) {printf("Div/0\n");}
  15.                                                                       else {DECO(accumulator); putchar('\n');};
  16.                                                                       endCLine = 1;
  17.                                                                       if (operator == 'q') endJob = 1;}
  18.                         else {
  19.                                         operand = DECI();
  20.                                         accumulator = operate(accumulator,operator,operand);
  21.                                  };
  22.                 }; /* end Command Line loop */
  23.         }; /* end Job loop */
  24.                        
  25. }

Raw Paste

Login or Register to edit or fork this paste. It's free.