Put your code in [code] tags to keep indentation, and use a monospace font.
This isn't useful, unless you are trying to truncate the value to 8 bits and even then it is system dependent.
Code:
if((mkdir(i, mod)) != 0)
You are supposed to pass a char*, not an int as the first parameter, just like the compiler told you
Code:
if((director=opendir(i)) == NULL)
Ditto, and be consisten about the use of NULL or 0. I prefer 0 myself.
Isolate the inside of the loop into a function, then just call it how ever many times you need to.
Code:
foo("0");
foo("1");
foo("2");
foo("3");
...