6. buildfile.c

#include <stdio.h>
int main()
{
FILE *out_file;
int count = 0;
char msg[] = "this was created by a C program.\n";
if ((out_file = fopen("testfile", "w")) == NULL)
{
printf("error opening file.\n");
exit (1);
}
while (count < 33)
{
fputc(msg[count], out_file);
count++;
}
fclose(out_file);
}