设名为“test.txt’’的文本文件的内容是1234567890ABCDEFabcdefgh。写出下列程序的输出结果。
#include"stdio.h"
main()
{FILE*fp;
chars[10];
if((fp=fopen("test.txt","r"))==NULL)
{printf("Filenotopen!\n");exit(0);}
while(!feof(fp))
{fgets(s,8,fp);printf("%s\
欢迎免费使用小程序搜题/刷题/查看解析,提升学历,成考自考报名,论文代写、论文查重请加客服微信skr-web
设名为“test.txt’’的文本文件的内容是1234567890ABCDEFabcdefgh。写出下列程序的输出结果。
#include"stdio.h"
main()
{FILE*fp;
chars[10];
if((fp=fopen("test.txt","r"))==NULL)
{printf("Filenotopen!\n");exit(0);}
while(!feof(fp))
{fgets(s,8,fp);printf("%s\n",s);}
fclose(fp);
}
1234567 890ABCD EFabcde fgh
×
提示:小程序已经收录此题,请在小程序查看名师解析。翰林刷小程序提供搜题,刷题,助你轻松通过考试