fprintf c

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

showing results for - "fprintf c"
Hugo
17 Apr 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}
Joaquin
26 Jul 2016
1int fprintf(FILE *fptr, const char *str, ...);
Ilene
08 Mar 2016
1int fprintf(FILE *stream, const char *format, ...)