1#include<stdio.h>
2int main() {
3 int i, x = 4;
4 char s[20];
5 FILE *f = fopen("new.txt", "w");
6 if (f == NULL) {
7 printf("Could not open file");
8 return 0;
9 }
10 for (i=0; i<x; i++) {
11 puts("Enter text");
12 gets(s);
13 fprintf(f,"%d.%s\n", i, s);
14 }
15 fclose(f);
16 return 0;
17}