Yes, it will go weird after 10 files, but that is all the OP put into his for loop, and this was the logic he chose.
I suggested using itoa(), but the OP wanted it that way.
Code:
for(i=0;i<10;i++)
{
//add[0]= (char) (i + '0'); //type conversion can help,
itoa(i, add, 10);
printf("%c",add[0]);
strcat(fileName,add); //concatenating to change file name everytime
fp=fopen(fileName,"wt");
fprintf(fp,"%s",s);
fclose(fp);
fileName[4] = '\0'; //resets fileName for the next number
}
Sprintf() is a better choice, but itoa() was the first thing that came to my mind. I leave that wrinkle, as an exercise for the OP.