C Program Of getc() and putc()

C Program Of getc() and putc()

#include<stdio.h>

main()
{

FILE *fp;
char ch;
fp=fopen("delu.txt","w");

printf("User input:\n");

while((ch=getchar())!=EOF)
{
putc(ch,fp);
}

fclose(fp);

printf("Output\n");

fp=fopen("delu.txt","r");

while((ch=getc(fp))!=EOF)
{

printf("%c",ch);

}
fclose(fp);



Related Posts