From 97c40693c5976d0f3b609620d77755e9b80c7d5c Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Wed, 7 Feb 2024 14:37:23 +0100 Subject: [PATCH] refactoring: case(for permutation and combination) --- src/main/c/Calculator/calculator.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 4cfafd2..193ed38 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -107,6 +107,14 @@ double combination(int n, int r); case 17: return tan(num1 * M_PI / 180.0); + case 18: + return permutation((int)num1, (int)num2); + case 19: + return combination((int)num1, (int)num2); + default: + return 0.0; + } +}