Browse Source

refactoring: case(for add and subtract)

remotes/origin/Ulrich
Ulriche Nguefack 11 months ago
parent
commit
d5c1f9f2f1
  1. 4
      src/main/c/Calculator/calculator.c

4
src/main/c/Calculator/calculator.c

@ -72,6 +72,10 @@ double combination(int n, int r);
} }
double performOperation(int choice, double num1, double num2) { double performOperation(int choice, double num1, double num2) {
switch (choice) { switch (choice) {
case 1:
return num1 + num2;
case 2:
return num1 - num2;

Loading…
Cancel
Save