From beefd7d76e4b1dfebbf1761ee91f5f1f56fc2fd1 Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Mon, 5 Feb 2024 19:55:48 +0100 Subject: [PATCH] case 2 entry --- src/main/c/Calculator/calculator.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 871b8b5..86dcaec 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -14,4 +14,16 @@ int main() { displayMenu(); printf("Enter your choice: "); scanf("%d", &choice); -switch (choice) { \ No newline at end of file +switch (choice) { + case 1: + printf("Enter two numbers: "); + scanf("%d %d", &num1, &num2); + result = add(num1, num2); + printf("Result: %d\n", result); + break; + case 2: + printf("Enter two numbers: "); + scanf("%d %d", &num1, &num2); + result = subtract(num1, num2); + printf("Result: %d\n", result); + break; \ No newline at end of file