added string2hex prog (usefull for wep key)
[my-code/beginners.git] / fact.c
1 #include <stdio.h>
2 #include <math.h>
3
4 int next_teiler(int x) {
5  int i;
6  if(x==1) {
7   printf("\ndone\n");
8   exit(0);
9  }
10  else {
11   for(i=2;i<=x;i++) {
12    if(x%i==0) {
13     printf("%d ",i);
14     next_teiler(x/i);
15    }
16   }
17  }
18 }
19
20 int main(int argc,char *argv[]) {
21 next_teiler(atoi(argv[1]));
22 return 0;
23 }