fork download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. FILE* pFile;
  8. double d;
  9. char s[100];
  10.  
  11. pFile = fopen("data1.txt", "wt");
  12. if (pFile == NULL) {
  13. return 1;
  14. }
  15. for (d = 0.1; d <= 10.0; d += 0.1) {
  16. fprintf(pFile, "%f\n", d * d);
  17. }
  18. fclose(pFile);
  19.  
  20. pFile = fopen("data1.txt", "rt");
  21. if (pFile == NULL) {
  22. return 1;
  23. }
  24. while (fgets(s, _countof(s), pFile)) {
  25. fputs(s, stdout);
  26. }
  27. fclose(pFile);
  28. return 0;
  29. }
  30.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty