diff --git a/01_ENV/build-c.sh b/01_ENV/build-c.sh index 48e6475..57fe08e 100755 --- a/01_ENV/build-c.sh +++ b/01_ENV/build-c.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash bash clean.sh -clang-6.0 -c func1.c main.c -lm -clang-6.0 -s func1.o main.o -lm +clang-6.0 -c func1.c main.c +clang-6.0 -s func1.o main.o -lm \ No newline at end of file diff --git a/01_ENV/func1.c b/01_ENV/func1.c index 0dc0564..fbdbe93 100644 --- a/01_ENV/func1.c +++ b/01_ENV/func1.c @@ -8,12 +8,12 @@ int func3(int x) { } int func2(int x) { - return x - 10; + return pow(x, 4) - 5 * pow(x, 3) + pow(x, 2) + 5; } int recurse1(int count) { if(count >= 0) { - printf("Recurse 1: %d\n", func3(count - 1)); + printf("Recurse 1: %d", func3(count - 1)); return recurse1(count - 1); }else return 0; } @@ -21,7 +21,7 @@ int recurse1(int count) { int recurse2(int count) { if(count >= 0) { - printf("Recurse 2: %d\n", func3(count - 1)); + printf("Recurse 2: %d", func3(count - 1)); return recurse1(count - 1); }else return 0; } \ No newline at end of file diff --git a/01_ENV/main.c b/01_ENV/main.c index 83dca98..361f0dc 100644 --- a/01_ENV/main.c +++ b/01_ENV/main.c @@ -24,19 +24,18 @@ int main(int argc, char **argv) { for(int i = 0; i <= 5; ++i) { tmp += func3(i); } - + printf("For: %d\n", tmp); - + tmp = 0; int j = 0; while(j <= 5) { tmp += func3(j); ++j; } - + printf("While: %d\n", tmp); - - + tmp = 0; int zeroes = 0; for(int i = 0; i <= 5; ++i) { @@ -47,8 +46,8 @@ int main(int argc, char **argv) { printf("Nullstellen: %d\n", zeroes); - //recurse1(20); - //recurse2(20); + recurse1(20); + recurse2(20); local = sum(global, local); return local;