题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-25 22:12:22

[单项选择]若有如下程序:
sub(int x)
int y=0; static int z=1;
y+=x+2;z+=y+x;
return(z);
main( )
int t=1,n;
for(n=0;n<3;n++)printf("%d,",sub(t));
则程序运行后的输出结果是 ( )
A. 5,5,5
B. 5,9,13,
C. 5,7,9,
D. 5,8,11,

更多"若有如下程序: sub(int x) int y=0; stati"的相关试题:

[单项选择]若有如下程序:
int sub( )
static int n=1;
int x=1;
x*=n;n++;
return x;
main( )
int n,t=1;
for(n=1;n<6;n++)t*=sub( );
printf("%d/n",t);
则程序运行后的输出结果是()
A. 15
B. 120
C. 34560
D. -30976
[填空题]若有如下程序:
void sub( )
static int x=6;
x/=2;printf("%d",x);
main( )
int m;
for(m=0;m<=2;m++) sub( );
则程序运行后的输出结果是 【17】
[单项选择]若有如下程序:
#include <iostream>
using namespaces std;
int s=0;
class samplestatic int n;
public:
sample(int i) n=i;static void add( ) s+=n;;
int sample:: n=0;
int main( )sample a(2),b(5);
sample:: add( );
cout<<s<<end1;
return 0;程序运行后的输出结果是( )。
A. 2
B. 5
C. 7
D. 3
[单项选择]若有如下程序:
sub(int a,int b,int *z)
*z=a+b;
return;
main( )
int a=1,b=2,c=3,d,e;
sub(a,b,&D) ;
sub(c,d,&e);
printf("%d",e);
则程序运行后的输出结果是 ( )
A. 3
B. 4
C. 5
D. 6
[单项选择]若有如下程序:
float sub(int a,int b)
return(a*b);
main( )
int i=1,j=2,k=3;
printf("%4.0f/n",sub((int)sub(k+j,j),k+i));

则程序运行后的输出结果是( )。
A. 40
B. 32
C. 16.0
D. 编译出错
[填空题]若有如下程序:
main( )
int x=20;
if(x>10)printf("%d",x-=5);
if(x>15)printf("%d",x);

则程序运行后的输出结果是 【11】
[填空题]若有如下程序:
sub(int*y)
while(--(*y));
printf("%d",(*y)--);
main( )
int x=10;
sub(&x);

则程序运行后的输出结果是 【13】
[单项选择]若有如下程序;
main( )
int m=-i;
printf("%d,%u,%o,%X",m,m,m,m);
则程序运行后的输出结果是( )。
A. -1,65535,177777,ffff
B. -1,-1,177777,fffe
C. -1,1,177777,ffff
D. -1,65535,177776,fffe
[单项选择]若有如下程序:
main( )
int a,b,C,m,n,k;
m=n=k=0; a=-1;b=2; C=3;
if(c>0)m=a+b;
if(a<=0)
if(b>0)
if(c<=0)n=a=b;

else if(c>0)n=a-b;
else k/=c;
printf("%d,%d, %d,",m,n,k);

则程序运行后的输出结果是( )。
A. 1,0,0
B. 2,-3,3
C. 1,-3,3
D. 1,0,3
[填空题]若有如下程序:
main( )
int x=5,y,*t;t=&x;
y=++(* t);
printf("%d,%d",x,y);
则程序执行后的x值为 【11】 ,y的值为 【12】
[单项选择]若有以下程序段:
struct st
int n;
int*m:

int a=2,b=3,c=5;
struct st s[3]=(101,&a,102,&c,103,&b);
main( )
struct st*p;
p=s;

则以下表达式中值为5的是()。
A. (*p).m
B. *(p+1)->m
C. *(p++)->n
D. (p++)(*m)
[单项选择]若有如下程序:
main( )
int x=3,y=4,z;
z=(x+(y-=X*X));
printf("%d,%d/n",y,z);

则程序执行后的输出结果是( )。
A. -4,2
B. -5,-2
C. -5,-1
D. 4,-2
[填空题]若有如下程序: main( ) {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d/n",*(t[1]+1), (*t) [1]); } 则程序运行后输出的结果是 【20】
[单项选择]若有以下程序段:
struct dent
int n;
int *m;

int a=1,b=2,c=3;
struct dent s[3]=101,&a,102,&b,103,&c;
struct dent *p=s;
则以下表达式中值为2的是( )。
A. (p++)->m
B. *(p++)->m
C. (*p).m
D. *(++p)->m
[单项选择]若有如下程序:
main( )
int a[3][4]=1,2,3,4,5,6,7,8,9;
printf("%d%d%d/n",a[0][1],a[1][2],a[2][3]);
则程序运行后的输出结果是 ( )
A. 270
B. 480
C. 160
D. 不定值
[单项选择]若有如下程序段;
int x=3,y=4,z;float a=2.0;
z=y%x/a;
则执行后,z中的值是 ( )
A. 4
B. 3.0
C. 0
D. 0.5
[单项选择]若有程序
fun(int a,int b)

static int c=0
c+=a+b;
retum c;

main( )

int x=5,y=3,z=7,r;
r=fun((y,x+y),z);
r=fun(x,y);
printf("%d/n",r);

上面程序的输出结果______。
A) 23 B) 15 C) 19 D) 18

我来回答:

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

订单号:

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