题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-03-22 03:31:17

[单项选择]阅读以下程序及对程序功能的描述,其中正确的是
#include<stdio.h>
main( )
FILE*in,*out;
charch,infile[10],outfile[10];
printf("Enter the infile name:/n");
scanf("%s",infile);
printf("Enter the outfile name:/n");
scanf("%s",outfile);
if((in=foen(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. 程序完成将两个磁盘文件合并并在屏幕上输出

更多"阅读以下程序及对程序功能的描述,其中正确的是 #include<st"的相关试题:

[单项选择]阅读以下程序及对程序功能的描述,其中正确的描述是
#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. 程序完成将两个磁盘文件合并并在屏幕上输出
[单项选择]阅读以下程序
#include<iostream.h>
void main( )

char line[10];
cin>>line;
cout<<line<<end1;

如运行时输入“This is an example. <CR>”,则程序的输出结果是( )。
A. This
B. This is
C. This is a D) This is an example
[单项选择]有以下程序 #include 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(&,1,1,fp); fclose(fp); printf("%c\n",t); } 程序执行后的输出结果是【 】。
A. d
B. c
C. b
D. a
[单项选择]有以下程序 #include #include main( ) { char a[5][10]={ "china","beijing","you","tiananmen","welcome"}; int i,j; char t[10]; for(i=0;i<4;i++) for(j=i+1;j<5;j++) if(strcmp(a[i],a[j])>0) {strcpy(t,a[i]); strcpy(a[i],a[j]); strcpy(a[j],t);} puts(a[3]); } 程序运行后的输出结果是_______。
A. beijing
B. china
C. welcome
D. tiananmen
[单项选择]阅读以下程序
#include<stdio.h>
main( )
Int Case;float printF;
printf("请输入2个数:");
scanf("%d %f",&Case,&printF);
printf("%d%f/n",Case,printF);

以下说法正确的是( )。
A. 定义浯句出错,Case是关键字,不能用作用户自定义标识符,printF不能用作用户自定义标识符
B. 定义语句出错,Int无法被识别
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出Case的值
[单项选择]阅读以下程序
#include <stdio.h>
main( )
int case;float printF;
printf("请输入2个数:");
scanf("%d %f",&case,&printF):
printf("%d %f/n",case,printF);

该程序在编译时产生错误,其出错原因是
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,PrintF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[单项选择]有以下程序 #include main( ) {struct STU{char name[9];char sex;double score[2]; }; struct STU a={"Zhao",m’’,85.0,90.0},b={"Qian",f’’,95.0,92.0}; b=a: printf("%s,%c,%2.0f,%2.0f/n",b.name,b.sex,b.score [0],b.score[1]); } 程序的运行结果是
A. Qian,f,95,92
B. Qian,m,85,90
C. Zhao,f,95,92
D. Zhao,m,85,90
[单项选择]

有以下程序,其中k的初值为八进制数
  #include
  main( )
  {int k=011;
  printf("%d/n",k++);
  }
  程序运行后的输出结果是()


A. 12
B. 11
C. 10
D. 9
[单项选择]阅读以下程序:
#include <stdio.h>
main( )
int case;float printF;
printf("请输入2个数:");
scanf("%d%f",&case,&printF);
printf("%d%f/n",case,printF);

该程序在编译时产生错误,其出错原因是
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,printF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[单项选择]阅读以下程序:
#include<stdio.h>
main( )
int case; float printF;
printf("请输入2个数:");
scanf("%d%f", &case, &printF);
printf("%d%f/n", case, printF);

该程序在编译时产生错误,其出错原因是
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,printF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[单项选择]请阅读以下程序:
#include<stdio.h>
main( )
int x=1, y=0, a=0, b=0;
switch(x)
case 1;
switch(y)
case 0:a++; break;
case 2:
a++, b++; break;
printf("a=%d, b=%d/n", a, b);

上面程序的输出结果是( )。
A. a=2, b=1
B. a=1, b=1
C. a=1, b=0
D. a=2, b=2
[单项选择]有以下程序 #include 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[S]); fclose(fp); fp=fopen("d2.dat","r"); fscanf(fp,"%d%d",&k,.&n);printf("%d%d\n",k,n); fclose(fp); } 程序运行后的输出结果是【 】。
A. 12
B. 14
C. 1234
D. 123456

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码