Browse Source

squareRootPlusOne

remotes/origin/Khaled
Khaled 11 months ago
parent
commit
5f4690b004
  1. 10
      src/c/funktionen.c

10
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;
}
}
Loading…
Cancel
Save