From ffba03ca7216bafbb9746ff8380c3cfa52502573 Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Wed, 7 Feb 2024 14:28:31 +0100 Subject: [PATCH] refactoring: case(for square root) --- src/main/c/Calculator/calculator.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 9b78f13..bdfbfc2 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -88,7 +88,12 @@ double combination(int n, int r); return log(num1); case 8: return pow(num1, num2); - + case 9: + return sqrt(num1); + case 10: + return num1 * num1; + case 11: + return num1 * num1 * num1;