From 0c9b2290c4a16a0c9f6e5c4453f3d3aa014ed3c7 Mon Sep 17 00:00:00 2001 From: Enrico Schellenberger Date: Wed, 31 Jan 2024 11:39:42 +0100 Subject: [PATCH] added divide function --- src/main/c/main_taschenrechner.c | 6 ++++-- src/main/c/taschenrechner.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index cec5d6f..74668c7 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -6,9 +6,7 @@ int add(int a, int b) { - return a+b; - } int minus (int a, int b){ @@ -18,3 +16,7 @@ int minus (int a, int b){ int multiply(int a, int b) { return a * b; } + +int divide(int a, int b) { + return a / b; +} diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index e1ca752..3147d9d 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -7,4 +7,6 @@ int minus(int a, int b); int multiply(int a, int b); +int divide(int a, int b); + #endif // TASCHENRECHNER_H