#include using namespace std; /* simple program to write "Hello World" to a file 100 times. */ int main() { FILE * outfile; outfile = fopen("myfile.txt", "w"); for(int i = 0; i < 100; i++) { fputs("Hello World\n ", outfile); } // close the file so that other programs can use it fclose(outfile); return 0; }