diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 3d33778..d3e8510 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -154,3 +154,13 @@ float naturalLogarithmPlusOne(float x) { } } +// Function to calculate the square root of a number and add 1 +float squareRootPlusOne(float x) { + if (x >= 0) { + return sqrt(x) + 1; + } + else { + printf("Error: Invalid input for square root + 1!\n"); + return 0; + } +}