#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("b.txt","a");
if(fp==NULL)
{
printf("\n unable to open file");
}
while((ch=getchar())!=EOF)
{
fputc(ch,fp);
}
fclose(fp);
getch();
}
#include<conio.h>
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("b.txt","a");
if(fp==NULL)
{
printf("\n unable to open file");
}
while((ch=getchar())!=EOF)
{
fputc(ch,fp);
}
fclose(fp);
getch();
}