WAP to write character to file and read character from file.

Defination :: WAP to write character to file and read character from file.

Source Code::

#include<stdio.h>
#include<conio.h>
void main()
{
    FILE *f;
    char ch;
    f=fopen("test.txt","w");
    while((ch=getchar())!=EOF)
    {
        putc(ch,f);
    }
    fclose(f);
    f=fopen("test.txt","r");
    while((ch=getc(f))!=EOF)
    {
        printf("%c",ch);
    }
    fclose(f);
    getch();
}
WAP to write character to file and read character from file. WAP to write character to file and read character from file. Reviewed by Unknown on 21:32 Rating: 5

No comments:

Powered by Blogger.