what is fprintf in c

Solutions on MaxInterview for what is fprintf in c by the best coders in the world

showing results for - "what is fprintf in c"
Aarón
28 Sep 2016
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}
Sara
12 Sep 2018
1int fprintf(FILE *fptr, const char *str, ...);