Browse Source

additional display menu 1

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

14
src/main/c/Calculator/calculator.c

@ -24,6 +24,7 @@ double cubeRoot(double num);
int main() {
double choice, num1, num2, result, angle;
int r,n;
do {
displayMenu();
@ -155,18 +156,25 @@ int main() {
printf("Invalid choice\n");
}
}
} while (choice != 5);
} while (choice != 20);
return 0;
}
// Function definitions
void displayMenu() {
printf("\nSimple Calculator\n");
printf("\nAdvaced Calculator\n");
printf("1. Add\n");
printf("2. Subtract\n");
printf("3. Multiply\n");
printf("4. Divide\n");
printf("5. Exit\n");
printf("5. Exponentiation\n");
printf("6. Modulus\n");
printf("7. Logarithm\n");
printf("8. Potential\n");
printf("9. Square Root\n");
printf("10. Square\n");
printf("11. Cube\n");
}
int add(int num1, int num2) {
return num1 + num2;

Loading…
Cancel
Save