首页 > 计算机类考试
题目内容 (请给出正确答案)
[主观题]

有以下程序include<stdio.h>main(){int i,n[]=(0,0,0,0,0);for(i=1;i<=4;i++){n[i]=n[

有以下程序

include<stdio.h>

main()

{int i,n[]=(0,0,0,0,0);

for(i=1;i<=4;i++)

{n[i]=n[i-1]*3+1;printf(”%d”,n[i]));}

}

程序运行后的输出结果是______。

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序include<stdio.h>main(){in…”相关的问题
第1题
有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a;

有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a; else return(fun(-a,-b)); } main() { printf("%d\n",fun(4,2)); } 程序的运行结果是______。

A.1

B.2

C.3

D.4

点击查看答案
第2题
有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); }

有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); } 程序运行后的输出结果是()。

A.tuv

B.字符t的ASCIl码值

C.t

D.出错

点击查看答案
第3题
有以下程序#include<stdio.h>#include<string.h>main(){char x[]=“STRING”;x[0]=0;

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char x[]=“STRING”;

x[0]=0;x[1]=’\0’;x[2]=’0’;

printf(”%d%d\n”,sizeof(x),strlen(x));

}

程序运行后的输出结果是()。

A.6 1

B.7 0

C.6 3

D.7 1

点击查看答案
第4题
有以下程序#include "stdio.h"main(){ struct date {int year,month,day;}today; printf("%d\n",sizeof(struct date));}程序的运行结果是

A.6

B.8

C.12

D.10

点击查看答案
第5题
有以下程序:#include<stdio.h>void fun(char *a,char*B){while(*a=='*')a++;while(*b=*A){b++;a+

有以下程序: #include<stdio.h> void fun(char *a,char*B){while(*a=='*')a++; while(*b=*A){b++;a++;} } main() {char*s="****a*b****",t[80]; fun(s,t);puts(t); } 程序的运行结果是()。

A.*****a*b

B.a*b

C.a*b****

D.ab

点击查看答案
第6题
有以下程序 #include<stdio.h> main() {int y=9; for(;y>0;y--) if(y%3==0)printf("%d",--y); } 程序的运行结粜是()。

A.741

B.963

C.852

D.875421

点击查看答案
第7题
有以下程序 include<stdio.h> main() { ints[12]={1,2,3,4,4,3,2,1,1,1,2,3),c[5]:{O},i

有以下程序 include<stdio.h> main() { ints[12]={1,2,3,4,4,3,2,1,1,1,2,3),c[5]:{O},i; for(i=0;i<12;i++)c[s[i]]++; for(i=1;i<5;i++)printf(%d,c[i]); printf(\n); }

A.4332

B.2344

C.1234

D.1123

点击查看答案
第8题
(21 )有以下程序# include (stdio.h >main (){ int a = l ; b = 2 ;for (; a < 8 ; a++ ) { b

(21 )有以下程序

# include (stdio.h >

main ()

{ int a = l ; b = 2 ;

for (; a < 8 ; a++ ) { b+=a ; a+=2 ; }

printf (" %d , %d \ n ", a , b ) ;

}

程序运行后的输出结果是

A ) 9 , 18

B ) 8 , 11

C ) 7 , 11

D ) 10 , 14

点击查看答案
第9题
有以下程序 #include<stdio.h> main() {char cl,c2; c1=A+8-4 c2=A+8-5; printf("%

有以下程序 #include<stdio.h> main() {char cl,c2; c1=A+8-4 c2=A+8-5; printf("%C,%d\n",cl,c2); } 已知字母A的ASCIl码为65,程序运行后的输出结果是()。

A.E,69

B.D,69

C.E,D

D.输出无定值

点击查看答案
第10题
有以下程序(strcat函数用以连接两个字符串)#include<stdio.h>#include<string.h>main(){char a[20]=”ABCD\0EFG\0”,b[]=”IJK”;strcat(a,b);printf(”%s\n”,a);}程序运行后的输出结果是()。

A.ABCDE\0FG\0IJK

B.ABCDIJK

C.IJK

D.EFGIJK

点击查看答案
第11题
有以下程序 #include<stdio.h>struct ord {int x,y;} dt[2]={1,2,3,4};main(){ struct ord

有以下程序

#include<stdio.h>

struct ord

{int x,y;} dt[2]={1,2,3,4};

main()

{

struct ord*p=dt;

printf(“%d,”,++(p一>x));printf(“%d\n”,++(p一>y));

}

程序运行后的输出结果是

A.1,2

B.4,1

C.3,4

D.2.3

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改