Point out the error, if any, in the following program.
# include "stdio.h"
main()
{
FILE *fp;
char str[80];
fp = fopen ("trail", "r");
while (!feof (fp))
{
fgets (str, 80, fp);
puts (str);
}
fclose (fp);
}5
822 5b5cc7dde4d2b419777515d1
Q: Point out the error, if any, in the following program. # include "stdio.h" main() { FILE *fp; char str[80]; fp = fopen ("trail", "r"); while (!feof (fp)) { fgets (str, 80, fp); puts (str); } fclose (fp); }
- Show Answer
- Workspace
- Discuss