This commit is contained in:
Johannes Theiner 2018-03-12 22:36:48 +01:00
parent 974ccc9f27
commit 5e6545aae8
3 changed files with 4 additions and 4 deletions

View File

@ -1,3 +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

View File

@ -4,8 +4,7 @@
#define func1
int func3(int x) {
//return pow(x, 3) - 3 * pow(x, 2) - x + 3;
return x + 10;
return pow(x, 3) - 3 * pow(x, 2) - x + 3;
}
int func2(int x) {
@ -25,4 +24,4 @@ int recurse2(int count) {
printf("Recurse 2: %d\n", func3(count - 1));
return recurse1(count - 1);
}else return 0;
}
}

View File

@ -19,7 +19,7 @@ int main(int argc, char **argv) {
printf("Funktion 1: %d\n" ,func3(2));
printf("Funktion 2: %d\n" , func2(2));
int tmp = 0;
for(int i = 0; i <= 5; ++i) {
tmp += func3(i);