1#include<stdio.h>
2
3int main()
4{
5 FILE *fp;
6 char ch;
7 fp = fopen("one.txt", "w");
8 printf("Enter data...");
9 while( (ch = getchar()) != EOF) {
10 putc(ch, fp);
11 }
12 fclose(fp);
13 fp = fopen("one.txt", "r");
14
15 while( (ch = getc(fp)! = EOF)
16 printf("%c",ch);
17
18 // closing the file pointer
19 fclose(fp);
20
21 return 0;
22}