题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-28 02:34:26

[单项选择]请阅读以下程序: #include<stdio.h> #include<string.h> void fun(int b[]) { static int i=0; do {b[i]+=b[i+1]; }while(++i<2);} main( ) { int k,a[5]={1,3,5,4,9}; fun(a); for(k=0;k<5;k++)printf("%d",a[k]);} 上面程序的输出是( )。
A. 13579
B. 48579
C. 48549
D. 48999

更多"请阅读以下程序: #include<stdio.h> #inclu"的相关试题:

[单项选择]请阅读以下程序: #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<fstream.h> void main( ) { ifstream infile; ofstream outfile; fstream iofile; iofile.open("a.txt",ios::in); iofile.close( ); iofile.open("b.txt",ios::out); } 下列描述错误的是
A. 对象infile只能用于文件输入操作
B. 对象outfile只能用于文件输出操作
C. 对象iofile在文件关闭后,不能再打开另一个文件
D. 对象iofile可以打开一个文件同时进行输入和输出
[单项选择]阅读以下程序 #include<iostream.h> void main( ) { char line[10]; cin>>line; cout<<line<<endl; } 如运行时输入This is example.<CR>,则程序的输出结果是
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]阅读以下程序 #include 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<iostream.h> void main( ) { charline[10]; in>>line; cout<<line<<endl; } 如运行时输入This is an example.<CR>,则程序的输出结果是( )。
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]阅读以下程序# include<fstream. h>void main( ){ifstream infile;ofstream outfile;{stream iofile;iofile. open("a. txt", ios:: in);iofile. close( );iofile. open('b. txt" ,ios: :out):....}下列描述错误的是
A. 对象infile只能用于文件输入操作
B. 对象outfile只能用于文件输出操作
C. 对象iofile在文件关闭后,不能再打开另一个文件
D. 对象iofile可以打开一个文件同时进行输入和输出
[单项选择]阅读以下程序 #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是关键字,不能用作用户自定义标识符,printF不能用作用户自定义标识符
B. 定义语句出错,Int无法被识别
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出Case的值
[单项选择]阅读以下程序: #include<iostream.h> voi6 main( ) { static int a[][2]={5,3,1,2}; int i,j,s1=0; for(i=0;i<2;i++) for(j=0;j<2;j++) { if(i==j) s1=s1+a[i][j]; } cout<<s1<<end1; } 则该程序的输出结果为( )。
A. 6
B. 7
C. 8
D. 9
[单项选择]阅读以下程序,写出程序运行后的输出结果是 ______。 #include<iostream.h> void main( ){ char a[]={'H','e','1','1','o','/0'}; int i,j; i=sizeof(a)/sizeof(char); j=strlen(a) cout<<i<<‘ ’<<j;
A. 6 6
B. 5 6
C. 1 5
D. 6 5
[单项选择]阅读下列程序,则在执行后,程序的运行结果为 #include"stdio.h" #include"string.h" main( ) { chara[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s/n",a);}
A. nice to meet you you
B. nice to
C. meet you you
D. nice to you
[单项选择]阅读下列程序段,则程序的输出结果为 #include "stdio.h" #define M(X,Y)(X)*(Y) #define N(X,Y)(X)/(Y) main( ) { int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d/n",k);} A)3 B)5 C)6 D)8
[单项选择]阅读下面程序,则程序段的功能是 #include"stdio.h" main( ) { int c[]={23,1,56,234,7,0,34},i,j,t; for(i=1;i<7;i++) { t=c[i];j=i-1; while(j>=0&&t>c[j]) { c[j+1]=c[j];j--;} c[j+1]=t} for(i=0;i<7;i++) printf("%d",c[i]); putchar('/n');}
A. 对数组元素的升序排列
B. 对数组元素的降序排列
C. 对数组元素的倒序排列
D. 对数组元素的随机排列
[单项选择]阅读下面程序,程序执行后的结果为( )。 #include"stdio.h" main( ) {char*str="abcdefghijklnmopq": while(*str++!='e'); printf("%c/n",*str); }
A. f
B. a
C. e
D. a
[单项选择]阅读下列程序段,则程序的输出结果为 #include"stdio.h" #defineM(X,Y)(X)*(Y) #defineN(X,Y)(X)/(Y) main( ) {f int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d/n",k);}
A. 3
B. 5
C. 6
D. 8
[单项选择]阅读下面程序: #include <iomanip. h> int main ( ) { cout<<setfill( '*' )<<setw( 8 ); cout<<setprecision( 5 )<<3.1415926<<end1; return 0; } 则该程序的输出结果是 ( )。
A. 3.1415**
B. ***3.1416
C. 3.141593
D. **3.14159

我来回答:

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

订单号:

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