#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
FILE *f;
char c=' ';
clrscr();
f=fopen("balaram.txt","a+");
if(f==NULL)
{
printf("\n can not open file");
exit(1);
}
printf("\n write data and to stop process press'#':");
while(c!='#')
{
c=getche();
fputc(c,f);
}
printf("\n contents read");
rewind(f);
while(!feof(f))
printf("%c",getc(f));
}