From 5aeb57ca5691226d87644ada60a87bfba91cc40b Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:08:13 +0100 Subject: [PATCH] squareroot funktion --- src/c/funktionen.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index e2b2251..ba5383b 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -8,4 +8,13 @@ float square(float x) { return x * x; } +float squareRoot(float x) { +if (x >= 0) { +return sqrt(x); +} else { +printf("Error: Invalid input for square root!\n"); +return 0; +} +} +