added ws202425 courses

This commit is contained in:
2024-11-14 13:11:04 +01:00
parent 800282c2e8
commit beb31897b1
461 changed files with 20368 additions and 0 deletions
@@ -0,0 +1,36 @@
#include <stdio.h>
#include <stdlib.h>
int y;
int func(int a, int b){
if (b == 0){
return -1;
}
else {
return (2 * (a * a)) / b;
}
}
int main (void){
int x = 4;
printf("Geben Sie eine ganze Zahl ein: ");
scanf("%i", &y);
int result = func(x,y);
if(result == -1){
printf("Ein Fehler ist aufgetreten.\n");
} else {
printf("Berechneter Wert: %i\n", result);
}
for(int i = 0; i <= 30; i++){
y = i;
result = func(x,y);
if(result == -1){
printf("Ein Fehler ist aufgetreten.\n");
} else {
printf("x: %i, y: %i, z: %i\n", x,y, result);
}
}
}