以下程序的功能是()。includemain(){FILE*fPl;*fp2;fp1:fopen("file1","r");fp2:fopen( 以下程序的功能是( )。 # include <stdio.h> main() {FILE*fPl; *fp2; fp1:fopen("file1","r"); fp2:fopen("file2","w"); while(! Feof(fP1)) fputc(fgetc(fP1),fp2); fclose(fP1);fclose(fp2);}A.将磁盘文件的内容显示在屏幕上B.将两个磁盘文件合为一个C.将一个磁盘文件复制到另一个磁盘文件中D.将两个磁盘文件合并后送屏幕
以下程序的功能是()。includemain(){FILE*fPl;*fp2;fp1:fopen("file1","r");fp2:fopen(
以下程序的功能是( )。 # include <stdio.h> main() {FILE*fPl; *fp2; fp1:fopen("file1","r"); fp2:fopen("file2","w"); while(! Feof(fP1)) fputc(fgetc(fP1),fp2); fclose(fP1);fclose(fp2);}
A.将磁盘文件的内容显示在屏幕上
B.将两个磁盘文件合为一个
C.将一个磁盘文件复制到另一个磁盘文件中
D.将两个磁盘文件合并后送屏幕
相关考题:
有以下程序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
有以下程序includemain(){FILE *fp;int i=20,j=30,k,n;fp=fopen("D1v.dat","w");fprin 有以下程序 #include<stdio.h> main() {FILE *fp;int i=20,j=30,k,n; fp=fopen("D1v.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); } 程序运行后的输出结果是( )。A.20 30B.20 50C.30 50D.30 20
有如下程序includemain(){FILE*fpl; fpl=fopen("f1.txt","w"); fprintf(fp1,"abc"); f 有如下程序 #include<stdio.h> main() { FILE *fpl; fpl=fopen("f1.txt","w"); fprintf(fp1,"abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为:good,则运行以上程序后文件f1.txt中的内容为A.goodabcB.abcdC.abcD.abcgood
有以下程序 include main(){FILE *fp;int i; char ch[]="abcd",t; fp=fopen("abc.dat" 有以下程序 #include <stdio.h> main() {FILE *fp; int i; char ch[]="abcd",t; fp=fopen("abc.dat","wb++"); for(i=O;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.bD.a
有以下程序include void WriteStr(char*fn,char*str){FILE*fp; fp=fopen(fn,"w");fpu 有以下程序 #include <stdio.h> void WriteStr(char *fn, char *str) { FILE *fp; fp=fopen(fn,"w"); fputs(str,fp);fclose(fp); } main() { WriteStr("t1.dat","start"); WriteStr("t1.dat","end"); } 程序运行后,文件t1.dat中的内容是A.startB.endC.startendD.endrt
有以下程序:includevoid WriteStr(char *fn, char *sir){FILE * fP; fP=fopen(fn,"w") 有以下程序: #include<stdio.h> void WriteStr(char *fn, char *sir) { FILE * fP; fP=fopen(fn,"w"); fput6(str,fp); fclose(fp); } main() { WriteStr("t1.dar","start"); WrlteStr("t1.dat","end"); } 程序运行后,文件t1.dat中的内容是( )。A.startB.endC.startendD.endrt
请补充main 函数,该函数的功能是:把文本文件B中的内容追加到文本文件A的内容之后。例如,文佃的内容为“I’m ten.”,文件A的内容为“I’ m a student!”,追加之后文件A的内容为“I’m a student !I’m ten.”注意:部分源程序给出如下。请勿改动主函数main 和其他函数中的任何内容,仅在函数main 的横线上填入所编写的若干表达式或语句。试题程序:include<stdio, h>include<conio. h>define N 80main(){FILE *fp, * fp1, *fp2;int i;char c[N] ,t, ch;clrscr ();if ((fp=fopen ("A. dat ", "r") ) == NULL){printf ("file A cannot be opened\n");exit (0);}printf("\n A contents are : \n\n");for (i=0; (ch=fgetc (fp)) !=EOF; i++){C [i]=ch;putchar (c [i]);fclose (fp);if((fp=fopen ("B. dat", "r") )==NULL){printf ("file B cannot be opened\n");exit (0);}printf("\n\n\nB contents are : \n\n");for (i=0; (ch=fgetc (fp)) !=EOF; i++){c [i] =ch;putchar (c [i]);}fclose (fp);if ( (fp1=fopen ("A.dat" ,"a"))【 】(fp2=fopen ("B. dat", "r") ) ){while ( (ch=fgetc (fp2)) !=EOF)【 】;}else{printf("Can not open A B !\n");}fclose (fp2);fclose (fp1);printf ("\n***new A contents***\n\n");if ( ( fp=fopen ("A. dar", "r") )==NULL){printf ("file A cannot be opened\n");exit (0);}for (i=0; (ch=fgetc (fp)) !=EOF;i++){c [i] =ch;putchar (c [i] );}【 】;}
有以下程序include main(){FILE *fp;int i=20,j=30,k,n;fp=fopen("d1.dat","w");fprin 有以下程序 #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"); fp=fscanf(fp,"%d%d",k,n); printf("%d%d\n",k,n); fclose(fp); } 程序运行后的输出结果是A.20 30B.20 50C.30 50D.3020
有以下程序: include main() {FILE *fp; int i,k,n; fp=fopen("data 有以下程序: #include <stdio.h> main() {FILE *fp; int i,k,n; fp=fopen("data.dat","w+"); for(i=1;i<6;i++) {fprintf(fp,"%d ",i); if(i%3==0) fprintf(fp,"\n"); } rewind(fp); fscanf(fp,"%d%d",k,n); printf("%d %d\n",k,n); fclose(fp); } 程序运行后的输出结果是 ______。A.0 0B.123 45C.1 4D.1 2
有以下程序:include main()FILE *fp; int i,k=0,n=0;fp=fopen("d1.dat","w");for(i=l 有以下程序: #include <stdio.h> main() FILE *fp; int i, k=0, n=0; fp=fopen("d1.dat","w"); for(i=l;i<4;i++) fprintf(fp,"%d",i); fclose(fp); fp=fopen("d1.dat","r"); fscanf(fp,'%d%d",k,n); printf("%d %d\n", k, n); fclose(fp); 执行后输出结果是A.1 2B.123 0C.1 23D.0 0
有如下程序:include main(){ FILE*fp1;fp1=fopen("f1.txt","w");fprintf(fp1, "abc"); 有如下程序: #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1, "abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为good,则运行以上程序后文件f1.txt中的内容为( )。A.goodabcB.abcdC.abcD.abcgood
有以下程序:includemain(){FILE*fp;int i,k=0,n=0; fp=fopen("d1.dat","w"); for(i=1; 有以下程序: #include <stdio.h> main() { FILE *fp;int i,k=0,n=0; fp=fopen("d1.dat","w"); for(i=1;i<4;i++) fprintf(fp,"%d",i); fclose(fp); fp=fopen("d1.dat","r"); fscanf(fp,"%d%d",k,n);printf("%d%d\n",k,n); fclose(fp); { 执行后的输出结果是( )。A.1 2B.123 0C.1 23D.0 0
有以下程序:includemain(){FILE*fp;int a[10]={1,2,3},i,n;fp=fopen("d1.dat","w");fo 有以下程序: #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",n); 程序的运行结果是( )。A.12300B.123C.1D.321
以下程序用来判断指定文件是否能正常打开,请填空。 include main() {FILE*fp;if(((fp=fo 以下程序用来判断指定文件是否能正常打开,请填空。include<stdio.h>main(){FILE*fp;if(((fp=fopen("test.txt","r"))=【 】))printf("未能打开文件!\n");elseprintf("文件打开成功!\n");}
有以下程序 include main() {FILE*f; f=fopen("filea.txt","w"); fprintf(f,"abc") fc 有以下程序#include<stdio.h>main(){ FILE*f;f=fopen("filea.txt","w");fprintf(f,"abc")fclose(f);}若文本文件filea.txt中原有的内容为:hello,则运行以上程序后,文件filea.txt中的内容为A.helloabcB.abcloC.abcD.abchello
有如下程序#include〈stdio.h〉main(){FILE *fp1;fp1=fopen("f1.txt","w");fprintf(fp1,"abc");fclose(fp1);}若文本文件f1.txt中原有内容为:good,则运行以上程序后文件f1.txt中的内容为A.goodabcB.abcdC.abcD.abcgood
以下程序的功能是# include stdio.hmain (){ FILE *fp1;*fp2; fp1=fopen ("file1","r"); fp2=fopen ("file2","w"); while (!feof (fp1)) fputc (fgetc (fp1),fp2); fclose (fp1); fclose (fp2);}A.将磁盘文件的内容显示在屏幕上 B.将两个磁盘文件合为一个C.将一个磁盘文件复制到另一个磁盘文件中D.将两个磁盘文件合并后送屏幕
有以下程序 include main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"ab 有以下程序 #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为:good,则运行以上程序后,文件n.txt中的内容为______。A.goodabcB.abcdC.abcD.abcgood
下述程序向文件输出的结果是_______。includevoid main(){ FILE*fp=fopen("TEST","wb") 下述程序向文件输出的结果是_______。 #include<stdio.h> void main() { FILE*fp=fopen("TEST","wb"); fprintf(fp,"%d%5.of%c%d",58,76273.0,'-'2278); fclose(fp); }A.5876273-2278B.5876273.000000-2278C.5876273-2278D.因文件为二进制文件而不可读
有以下程序includemain(){FILE *fp;int i=20,j=30,k,n;fp=fopen("d1.dat","w");fprint 有以下程序 #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);} 程序运行A.20 30B.20 50C.30 50D.30 20
有如下程序includemain(){FILE*fp1;fp1;fopen("ftxt","w");fprintf(fpl, "abc")fclose 有如下程序 #include <stdio.h> main() { FILE *fp1; fp1;fopen("ftxt","w"); fprintf(fpl, "abc") fclose(fpl); } 若文本文件f1.txt中原有内容为:good,则运行以上:程序后文件f1.Mt中的内容为A.goodabcB.abcdC.abcD.abcgood
以下程序的功能是()includemain(){FILE * fp1;*fp2;fp1=fopen("filel","r");fp2=fopen 以下程序的功能是( ) #include<stdio.h> main() {FILE * fp1; *fp2; fp1=fopen("filel","r"); fp2=fopen("file2","w"); while(!feof(fp1)) fputc(fgetc(fp1),fp2); fclose(fp1);fclose(fp2);}A.将磁盘文件的内容显示在屏幕上B.将两个磁盘文件合为一个C.将一个磁盘文件复制到另一个磁盘文件中D.将两个磁盘文件合并后送屏幕
有以下程序: include main( ) { FILE *fp; int i=20,j=50,k,n; fp=fopen("d1.da 有以下程序: #include<stdi0.h> main( ) { FILE *fp; int i=20,j=50,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); } 程序运行后的输出结果是A.20 30B.20 50C.30 50D.30 20
有如下程序: include main ( ){FILE* fpl;fp1 = fopen("ftxt" ,"w");fpfinff( fp1 ," 有如下程序: #include <stdio.h> main ( ) { FILE* fpl; fp1 = fopen("ftxt" ,"w"); fpfinff( fp1 ," abc" ); fclose ( fp1 ); 若文本文件f1.txt中原有内容为:good,则运行以上程序后文件f1.txt中的内容为( )。A.goodabcB.abcdC.abcD.abegood
有如下程序:include main (){FILE*fp1;fp1=fopen ("fl.txt", "w");fprintf(fp1,"abc" 有如下程序:#include <stdio. h>main (){ FILE *fp1; fp1=fopen ("fl.txt", "w"); fprintf(fp1,"abc"); fclose (fp1);}若文本文件f1.txt 中原有内容为:good,则运行以上程序后文件f1.txt 中的内容为( )。A.goodabcB.abedC.abcD.abcgood
下列程序的功能是()。 #include main( ) { FILE *fp1,*fp2; fp1=fopen(“d1.dat”,“r”); fp2=fopen(“d2.dat”,“w”); while(!feof(fp1)) fputc(fgetc(fp1),fp2)); fclose(fp1); fclose(fp2); }
填空题下列程序的功能是()。 #include main( ) { FILE *fp1,*fp2; fp1=fopen(“d1.dat”,“r”); fp2=fopen(“d2.dat”,“w”); while(!feof(fp1)) fputc(fgetc(fp1),fp2)); fclose(fp1); fclose(fp2); }