*make sure that this program give correct o/p to corresponding i/p/*
#include<stdio.h>
#include<conio.h>
void main()
{
char fname[15];
FILE *f;
char c;
printf("Enter the file name");
scanf("%s",&fname);
f=fopen(fname,"w");
while(c=getch()!='#')
fputc(f,c);
fclose(f);
f=fopen(fname,"r");
while(c=fgetc(f)!=EOF)
printf("%c",c);
getch();
fclose(f);
f=fopen(fname,"r");
while(f=fgetc(c)!=EOF)
printf("%c",c);
getch();
}
<< moderator edit: added [co[u][/u]de][/co[u][/u]de]
tags >>