C_CPP/01_ENV/Testat/main.c

30 lines
544 B
C
Raw Normal View History

2018-03-20 13:12:11 +01:00
#include <stdio.h>
#include "func1.h"
int recursive(int start, int stop);
int main(int argc, char **argv) {
int zero = 0;
for(int i = 0; i <= 20; ++i) {
int tmp = func1(i);
printf("Stelle: %d Wert: %d\n", i, tmp);
if(tmp == 0) ++zero;
}
printf("Nullstellen: %d\n", zero);
recursive(0, 20);
}
int recursive(int start, int stop) {
if(start <= stop) {
recursive(start + 1, stop);
printf("Stelle: %d, Wert: %d\n", start, func1(start));
}
return 0;
}