C program to read from file.

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
 clrscr();
 char c[1000];
 FILE *fp;
 if((fp=fopen("abc.txt", "r"))==NULL)
 {
  printf("Not able to open file");
  getch();
  exit(1);
 }
 fscanf(fp, "%s", c);
 printf("File data : %s",c);
 fclose(fp);
 getch();
}
C program to read from file. C program to read from file. Reviewed by on December 26, 2019 Rating: 5

No comments:

Powered by Blogger.