HOME

Tuesday, April 14, 2015

C PROGRAM TO READ THE DATA FROM THE FILE

#include<stdio.h>
#include<conio.h>
void main()
{
    FILE *fp;
    char *p,data[20];
    fp=fopen("file.txt","r");
    while((p=fgets(data,40,fp))!=NULL)
    {
        printf("%s\n",data);
    }
    fclose(fp);
}

No comments:

Post a Comment