Advertisement
Md_hosen_zisad

6NOV17 FILE

Nov 7th, 2017
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main()
  5. {
  6. FILE *fp;
  7. fp=fopen("D:\\newfile.txt","w");
  8. fputs("Name:Md.HOSEN ZISAD\n",fp);
  9. fputs("Id:1603110201311\n",fp);
  10. fputs("Sem: 2nd\n",fp);
  11. fputs("Sec: C\n",fp);
  12. fputs("Institution : Premier University Of Chittagong\n",fp);
  13. fputs("Address: Chittagong , Bangladesh\n",fp);
  14. fputs("Blood Group : A+\n",fp);
  15. fputs("Program: Bsc. in CSE\n",fp);
  16. fputs("Session : January 2017",fp);
  17. fclose(fp);
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. #include<stdio.h>
  26. #include<stdlib.h>
  27.  
  28. int main()
  29. {
  30. FILE *fp;
  31. fp=fopen("D:\ZISAD(1603110201311)newfile.txt","r");
  32.  
  33. char c[100];
  34. while(fscanf(fp,"%s",c)!=EOF)
  35. {
  36. puts(c);
  37. }
  38.  
  39. fclose(fp);
  40.  
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. #include<stdio.h>
  50. #include<stdlib.h>
  51.  
  52. int main()
  53. {
  54. FILE *fp;
  55. int i;
  56. char c;
  57. fp=fopen("D:\ZISAD(1603110201311)newfile.txt","w");
  58.  
  59.  
  60. for(i=0;i<=10;i++)
  61. {
  62. if(c=='?')
  63. break;
  64. c=getchar();
  65. fputc(c,fp);
  66. }
  67.  
  68. fclose(fp);
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement