This commit is contained in:
2024-11-28 11:27:09 +01:00
parent d6f5f0cac9
commit aa2ff99dcf
53 changed files with 4366 additions and 27 deletions
+37
View File
@@ -0,0 +1,37 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
int main(int argc, char *argv[]){
double value;
double cubic_value;
char *endptr;
if (argc != 2){
printf("Nur einen Parameter eingeben\n");
return 1;
}
errno = 0;
value = strtod(argv[1], &endptr);
if (errno == ERANGE) {
printf("Der Wert ist außerhalb des darstellbaren Bereichs.\n");
return EXIT_FAILURE;
}
if (endptr == argv[1]) {
printf("Keine gültige Zahl gefunden.\n");
return EXIT_FAILURE;
}
cubic_value = value * value * value;
printf("Value: %f\n", value);
printf("Cubic Value: %f\n", cubic_value);
return EXIT_SUCCESS;
}