[单选题]

有以下程序

#inculde <stdio.h>

main()

{ FILE*Fp;char str[10];

F.p=Fopen(“myFile.dat”,”W”);

F.puts(“aBc”,Fp);Fclose(Fp);

F.p=Fopen(“myFile.dat”,”a+”);

F.printFF(Fp,”%d”,28);

reWind(Fp);

F.scanF(Fp,”%s”,str);puts(str);

F.close(Fp);

}

程序运行后的输出结果是

A.aBc

B.28c

C.aBc28

D.因类型不一致而出错

参考答案与解析:

相关试题

有以下程序#inculde <stdio.h>main(){FILE*Fp;ch

[单选题]有以下程序#inculde <stdio.h>main(){ FILE*Fp;char str[10];F.p=Fopen(“myFile.dat”,”W”);F.puts(“aBc”,Fp);Fclose(Fp);F.p=Fopen(“myFile.dat”,”a+”);F.printFF(Fp,”%d”,28);reWind(Fp);F.scanF(Fp,”%s”,str);puts(str);F.close(Fp);}程序运行后的输出结果是A.aBcB.28cC.aBc28D.

  • 查看答案
  • 有以下程序:include<stdio.h>main( ){FILE*fp;ch

    [单选题]有以下程序:include<stdio.h>main( ){FILE*fp;char str[10];fp=fopen("myfile,dat","");{puts("abe",ip);fclose(fp);fp=fopen("myfile.dat","a*");fprintf(fp,"%d",28);rewind(fp);fscanf(fp,"%S&qu

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ FILE *fp;

    [单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int i;char ch[]="abcd",t;fp=fopen("abc.dat","wb+");for(i=0; i<4; i++) fwrite(&ch[i],1,1,fp);fseek(fp,-2L,SEEK_END);fread(&t,1,1,fp);fclose(fp);printf("%c/n",t);}程序执行后的输出结果是A.)dB.)cC.)b

  • 查看答案
  • 有以下程序#include <stdio.h>main( ){ FILE *fp

    [单选题]有以下程序#include <stdio.h>main( ){ FILE *fp; int k,n,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w");fprintf(fp, "%d%d%d/n",a[0],a[1],a[2]); fprintf(fp,"%d%d%d/n",a[3],a[4],a[5]);fclose(fp);fp=fopen("d2.dat", " r");fscanf(fp, "%d%d",&k

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ FILE *fp;

    [单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int a[10]={1,2,3},i,n;fp=fopen("dl.dat","w");for(i=0;i<3;i++) fprintf(fp,"%d",a[i]);fprintf(fp,"/n");fclose(fp);fp=fopen("dl.dat","r");fscanf(fp,"%d",&n);fclose(fp);printf("%d/n",n

  • 查看答案
  • 有以下程序 #include<stdio.h> main() {FILE*fp;

    [单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int i=20,j=30,k,n;fp=fopen("d1.dat","w");fprintf(fp,"%d\n",i);fprintf(fp,"%d\n",j);fclose(fp);fp=fopen("d1.dat","r");fscanf(fp,"%d%d",&k,&n); printf("%d %d\n",k,n);fclose(fp);}程序运

  • 查看答案
  • 有以下程序 #include<stdio.h>main(){FILE*fp;it

    [单选题]有以下程序#include<stdio.h>main(){F.ILE *fp; it a[10]={1,2,3,0,0};fp=fopen(“d2.dat”,”wb”);fwrite(a,sizeof(int),5,fp);fwrite(a,sizeof(int),5,fp);fclose(fp);fp=fopen(“d2.dat”,”rb”);fread(a,sizeof(int),10,fp);for(i=0;i<10;i++) printf(“%d”,A.;}程序运行结果

  • 查看答案
  • 有以下程序:include<stdio.h> main( ){ FILE*fp;

    [单选题]有以下程序:include<stdio.h> main( ){ FILE*fp; int i,a[6]={1,2,3,4,5,6}; fp=fopen(&q有以下程序:include<stdio.h>main( ){ FILE*fp; int i,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w+");for=(i=o;i<6;,i++)fpintf(fp,"%d/n",a[i

  • 查看答案
  • 有以下程序 #include<stdio.h> main() {FILE *fp

    [单选题]有以下程序#include<stdio.h>main(){FILE *fp; int i,a[6]={l,2,3,4,5,6};fp=fopen("d3.dat","w+b");fwrite(a,sizeof(int),6,fp);fseek(fp,sizeof(int)*3,SEEK_SET);/*该语句使读文件的位置指针从文件头向后移动3个int型数据*/fread(a,sizeof(int),3,fp); fclose(fp);for(i=0;i<6;i++)pr

  • 查看答案
  • 有以下程序 #include<stdio.h> main() {FILE*fp

    [单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int a[10]={1,2,3},i,n;fp=fopen("d1.dat","w");for(i=0;i<3;i++) fprintf(fp,"%d",a[i]);fprintf(fp,"/n");fclose(fp);fp=fopen("d1.dat","r");fscanf(fp,"%d",&n);fclose(fp);printf("%d/n",

  • 查看答案
  • 有以下程序#inculde <stdio.h>main(){FILE*Fp;ch