From e0aa1c901879e72cfdea86436b5d86ee55698885 Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Mon, 5 Feb 2024 20:52:07 +0100 Subject: [PATCH] case exponent --- src/main/c/Calculator/calculator.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 5733aa7..da9d5f1 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -23,7 +23,7 @@ int main() { displayMenu(); printf("Enter your choice: "); scanf("%d", &choice); -switch (choice) { + switch (choice) { case 1: printf("Enter two numbers: "); scanf("%d %d", &num1, &num2); @@ -52,7 +52,13 @@ switch (choice) { printf("Result: %d\n", result); } break; - case 5: + case 5: + printf("Enter base and exponent: "); + scanf("%lf %lf", &num1, &num2); + result = exponent(num1, num2); + printf("Result: %lf\n", result); + break; + case : printf("Exiting...\n"); break; default: