From 4c001aa86d981a5be774922e56779fc0b344786b Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Mon, 5 Feb 2024 21:50:46 +0100 Subject: [PATCH] additional display menu 1 --- src/main/c/Calculator/calculator.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index c053787..7616c8b 100644 --- a/src/main/c/Calculator/calculator.c +++ b/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;