题目内容 (请给出正确答案)
[主观题]

阅读以下程序及对程序功能的描述,其中正确的描述是 #include<stdio.h> main() {

阅读以下程序及对程序功能的描述,其中正确的描述是

#include <stdio.h>

main()

{

FILE *in,*out;

char ch,infile[10],outfile[10];

printf("Enter the infile name:\n");

scanf("%s",infile);

printf("Enter the outfile name:\n");

scanf("%s",outfile);

if((in=fopen(infile,"r"))==NULL)

{

printf("cannot open infile\n");

exit(0);

}

if((out=fopen(outfile,"w"))==NULL)

{

printf("cannot open outfile\n");

exit(0);

}

while(! feof(in))fputc(fgetc(in),out);

fclose(in);

fclose(out);

}

A.程序完成将磁盘文件的信息在屏幕上显示的功能

B.程序完成将两个磁盘文件合二为一的功能

C.程序完成将一个磁盘文件复制到另一个磁盘文件中

D.程序完成将两个磁盘文件合并并在屏幕上输出

提问人:网友policecdc 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“阅读以下程序及对程序功能的描述,其中正确的描述是 #incl…”相关的问题
第1题
阅读以下程序及对程序功能的描述,其中正确的是

#include

main()

{ FILE *in,*out;

char ch,infile[10],outfile[10];

printf("Enter the infile name:\n");

scanf("%s",infile);

printf("Enter the outfile name: \n");

scanf("%s",outfile);

if((in=fopen(infile,"r"))==NULL)

{ printf("cannot open infile\n");

exit(0); }

if((out=fopen(outfile,"w"))==NULL)

{ printf("cannot open outfile\n");

exit(0); }

while(! feof(in))fputc(fgetc(in),out);

fclose(in);fclose(out); }

A.程序完成将磁盘文件的信息在屏幕上显示的功能

B.程序完成将两个磁盘文件合二为一的功能

C.程序完成将一个磁盘文件复制到另一个磁盘文件中

D.程序完成将两个磁盘文件合并并在屏幕上输出

点击查看答案
第2题

阅读以下程序及对程序功能的描述,其中正确的描述是#include main(){ FILE *in,*out; char ch,infile[10],outfile[10]; printf("Enter the infile name:\n"); scanf("%s",infile); printf("Enter the outfile name:\n"); scanf("%s",outfile); if((in=fopen(infile,"r"))==NULL) { printf("cannot open infile\n"); exit(0); } if((out=fopen(outfile,"w"))==NULL) { printf("cannot open outfile\n"); exit(0); } while(! feof(in))fputc(fgetc(in),out); fclose(in); fclose(out);}A.程序完成将磁盘文件的信息在屏幕上显示的功能B.程序完成将两个磁盘文件合二为一的功能C.程序完成将一个磁盘文件复制到另一个磁盘文件中D.程序完成将两个磁盘文件合并后在屏幕上输出

点击查看答案
第3题
程序填空。程序功能:将一组整数从大到小排序。 #include <stdio.h> #define N 5 void main( ) { int i, j, temp, score[N] = {12,4,25,8,3}; for ( i=0 ;i<n-1;i++) { for (j="i+1;__________;" j++) if(score[i] score[j]) temp="score[i];" score[i]="score[j];" score[j]="temp;" } ( i="0;i&lt;N;i++)" printf("%d\t", score[i]); 上面程序代码中空白处所填语句正确的为(> A、j<n<br> B、j<n-1<br> C、j<=n<br> D、j<n-1-i<br>
点击查看答案
第4题
以下程序的功能是:给r输入数据后计算半径为r的圆面积s。#include <stdio, h>main()/* Beginning */{ int r; float s; scanf("% d", &r); s = *Π* r*r;printf("s =%f\n",s); 程序在编译时出错,出错的原因是()。

A.注释语句书写位置错误

B.存放圆半径的变量r不应该定义为整型

C.输出语句中格式描述符非法

D.计算圆面积的赋值语句中使用了非法变量

点击查看答案
第5题
编译预处理命令是计算机将C语言编译为机器语言是进行的预处理,编译预处理命令以 开头

A、#

B、$

C、*

D、&

点击查看答案
第6题
若在程序中需要用到strlen()函数时,应在程序起始部分书写预处理命令,包含头文件【 】.
点击查看答案
第7题
不管在main()函数行之前有多少个宏命令,#include<stdio.h>命令必须是第一个宏命令。
点击查看答案
第8题
以下程序调用函数的顺序为() #include <stdio.h> int f1(int a, int b); int f2(int a, int b); int f3(int a, int b); int f4(int a, int b); int main() { int a, b,ans; a = 1; b = 2; ans = f1(a, b); } int f1(int a, int b) { return f2(a,b); } int f2(int a, int b) { if (a>b) return f3(a, b); return f4(a, b); } int f3(int a, int b) { return a - b; } int f4(int a, int b) { return b - a; }

A、f1->f2->f3->f4

B、f1->f2->f3

C、f1->f2->f4

D、f4->f3->f2->f1

点击查看答案
第9题
fscanf函数的正确调用形式是()。

A、fscanf(fp,格式字符串,输入项表)

B、fscanf(fp,输入项表,格式字符串)

C、fscanf(格式字符串,输出项表,fp)

D、fscanf(输入项表,格式字符串,fp)

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信