Advertisement
Md_hosen_zisad

8-11-17

Nov 7th, 2017
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1.  
  2. file integer value read to write
  3.  
  4. #include<stdio.h>
  5. #include<stdlib.h>
  6.  
  7. int main()
  8. { int i;
  9.     FILE *fp;
  10.     fp=fopen("D:\\Filepblm3.txt","w");
  11. for(i=1;i<=5;i++)
  12. {
  13. fprintf(fp,"%d\n",i);
  14. }
  15.  
  16. fclose(fp);
  17.  
  18. return 0;
  19. }
  20.  
  21. ..,,,,,.,,,,,,,,,,,,,,,,,,
  22. #include<stdio.h>
  23. #include<stdlib.h>
  24.  
  25. int main()
  26. {
  27.    FILE *fp;
  28.     fp=fopen("D:\\Filepblm3.txt","r");
  29. int i,num;
  30. //  char string[100];
  31.   //while(fscanf(fp,"%s",string)!=EOF)
  32.  // {
  33.     for(i=1;i<=5;i++)
  34.     {
  35.   fscanf(fp,"%d",&num);
  36.         printf("%d\n",num*num);
  37.     }
  38.  
  39.  
  40. //fclose(fp);
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement