网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
有以下程序:includemain(){ FILE *fp;int a[10]={1,2,3,0,0},i;fp=fopen("d2.dat","wb

有以下程序: #include<stdio.h> main() { FILE *fp;int a[10]={1,2,3,0,0},i; 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); fclose(fp); for(i=0;i<10;i++)printf("%d,",a[i]); } 程序的运行结果是( )。

A.1,2,3,0,0,0,0,0,0,0,

B.1,2,3,1,2,3,0,0,0,0,

C.123,0,0,0,0,123,0,0,0,0,

D.1,2,3,0,0,1,2,3,0,0,


参考答案

更多 “ 有以下程序:includemain(){ FILE *fp;int a[10]={1,2,3,0,0},i;fp=fopen("d2.dat","wb 有以下程序: #include<stdio.h> main() { FILE *fp;int a[10]={1,2,3,0,0},i; 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); fclose(fp); for(i=0;i<10;i++)printf("%d,",a[i]); } 程序的运行结果是( )。A.1,2,3,0,0,0,0,0,0,0,B.1,2,3,1,2,3,0,0,0,0,C.123,0,0,0,0,123,0,0,0,0,D.1,2,3,0,0,1,2,3,0,0, ” 相关考题
考题 有以下程序#include stido.hmain(){ FILE *fp; int a[10]={1,2,3,0,0},i;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);fclose(fp);for(i=0;i10;i++) printf("%d",a[i]);}程序的运行结果是A)1,2,3,0,0,0,0,0,0,0,B)1,2,3,1,2,3,0,0,0,0,C)123,0,0,0,0,123,0,0,0,0,D)1,2,3,0,0,1,2,3,0,0,

考题 有以下程序includemain(){FILE*fp;int k,n,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w" 有以下程序 #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,nA.1 2B.1 4C.123 4D.123 456

考题 有以下程序includemain(){FILE*fp;inta[10]={1,2,3},i,n;fp=fopen("d1.daf","w");for( 有以下程序 #include <stdio.h> main() {FILE *fp; int a[10]={1,2,3},i,n; fp=fopen("d1.daf","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);A.12300B.123C.1D.321

考题 有以下程序 include main() { FILE *fp; int' a[10]={1,2,3,0,0},i; 有以下程序 #include <stdio.h> main() { FILE *fp; int' a[10]={1,2,3,0,0},i; fp = fopen("d2.dat", "wb"); fwrite(a, sizeof(int), 5, fp); fwrite(a, sizeof(int), 5, fp); fclose(fp); fp = fopenCd2.dat", "rb"); fread(a, sizeof(int), 10, fp); fclose(fp); for (i=0; i<10; i++) printf("%d,", a[i]); }A.1,2,3,0,0,0,0,0,0,0,B.1,2,3,1,2,3,0,0,0,0,C.123,0,0,0,0,123,0,0,0,0,D.1,2,3,0,0,1,2,3,0,0,

考题 有以下程序:includemain(){ FILE*fp;int i;char ch[]="abcd",t;fp=fopen("abc.dat","w 有以下程序: #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); fseck(fp,-2L,SEEK_END) ; fread(t,1,1,fp); felose(fp); printf("%c\n",t); } 程序执行后的输出结果是( )。A.dB.cC.bD.a

考题 有以下程序 #includestdi0.h main {FILE*fp;int a[0]一{1,2,3,0,0},i; 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); fclose(fp); for(i=0;i10;i++)printft("%d",a[i]); } 程序的运行结果是( )。A.1,2,3,0,0,o,0,0,0,0,B.1,2,3,1,2,3,0,0,0,0,C.123,0,0,0,0,123,0,0,0,0,D.1,2,3,0,0,1,2,3,0,0,

考题 有以下程序:includemain(){FILE *fp;int i,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w" 有以下程序: #include<stdio.h> main() {FILE *fp;int i,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\n",k,A.1 2B.1 4C.123 4D.123 456

考题 有以下程序#includemain{ FILE *fp;int a[10]={1,2,3,0,0},i;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);fclose(fp);for(i=0;i10;i++) printft(%d,a[i]);}程序的运行结果是( )。A.1,2,3,0,0,0,0,0,0,0,B.1,2,3,1,2,3,0,0,0,0,C.123,0,0,0,0,123,0,0,0,0,D.1,2,3,0,0,1,2,3,0,0,

考题 有以下程序#includestdio.hmain(){FILE *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;i10;i++) printf(“%d”,A.;}程序运行结果是( )。