Looks a little better, you should work on the indentation. Comments:
- You must close your file before you exit the program, otherwise the contents will be undefined if you tried to write to it.
- For text files you should end with a newline.
- When you open a file you need to make sure it actually worked. What if "d:\\crypt.h" is not writable?
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
const char *filename = "c:\\crypt.h";
FILE *fp;
fp=fopen(filename, "w");
if (fp == NULL) {
perror(filename);
exit(1);
}
fprintf(fp, "char out[8];char cur[8];"
"char con[255,255,255,255,255,255,255,255];/n"
"if cur==con out==0,0,0,0,0,0,0,0;/n"
"while(cur <= con) /n"
"con=con-1/n"
"if cur>=con out=out+1;"
);
fprintf(fp, "\n");
fclose(fp);
return 0;
}