分析下列程序:include<stdio.h>main(){ int*p1,*p2,*p;inta=6,b=9;p1=&a;p2=&b;if(a<B) {p=p1;p1=p2;p2=p;}printf("%d,%d",*p1,*p2) ;printf("%d,%d",a,B) ;}程序的输出结果为()。
A.9,6 6,9
B.6,9 9,6
C.6,9 6,9
D.9,6 9,6
时间:2023-01-20 20:43:51
-
阅读下列程序,则在执行后,程序的运行结果为( ).#include stdio.h#include string.hmain( ){ char a[30]=nice to meet you!
-
下列程序的输出结果是()。 include<stdio.h> main() { int a=4; print f("%d\n", (a+=a-=a*a)); }
A.-8
B.14
C.0
D.-24
-
下列程序的输出结果是()。include<stdio.h>int b=2:int func(int*a){ b+=*a;return b;}ma
下列程序的输出结果是()。
include<stdio.h>
int b=2:
int func(int*a)
{ b+=*a;return b;}
main
{ int a=1,t=2;
t+=func(&a):
printf("%d\n",t);
}
A.4
B.5
C.6
D.8
-
下列程序的输出结果是()。include<stdio.h>include<string.h>main(){ char a[]="\n123\\"; printf("%d,%d\n",strlen(A) ,sizeof(A) );}
A.5,6
B.5,5
C.6,6
D.6,5
-
下列程序的输出结果是()。 include<stdio.h> main { int a=3,b=2,c=1; if(a<b) if(b&l
下列程序的输出结果是()。 include<stdio.h> main { int a=3,b=2,c=1; if(a<b) if(b<0)c=0; else c++: printf("%d\n",c); }
A.2
B.0
C.1
D.不确定的值
-
下列程序的输出结果是______。include <stdio.h>main(){ int i=1,j=3; printf("%d,",i++); {int
下列程序的输出结果是______。include <stdio.h>main (){ int i=1,j=3; printf("%d,",i++); { int i=0; i+=j*2; printf("%d,%d,",i,j); } printf("%d,%d\n",i,j);}
A.1,6,3,1,3
B.1,6,3,2,3
C.1,6,3,6,3
D.1,7,3,2,3
-
下列程序的执行结果是______。include<stdio.h>union un{int i; char c[2};};void main(){union
下列程序的执行结果是______。 include<stdio.h> union un { int i; char c[2}; }; void main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n%d",x.i); }
A.266
B.11
C.265
D.138
-
分析下面的程序,指出程序中的错误:# include <stdio.h>int main( void){ char a; char *str=&a; strcpy(str,"hello"); printf("%s",str); return 0;}
-
下列程序的输出结果是______。 include<stdio.h> main() { int a=2,b=-1,C=2;
下列程序的输出结果是______。 include<stdio.h> main() { int a=2,b=-1,C=2; if(a<B) if(b<O)c=0; else c++; printf("%d\n",C) ; }
-
include<stdio.h>main(); } 程序运行后的输出结果是
A.0,0
B.0,-1
C.-1,-1
D.结果不确定
-
有以下程序 include<stdio.h>void main()
A.10 9 8
B.9 8 7
C.10 9 8 7
D.9 8 7 6
-
有下列程序 include<stdio.h>main()); } 程序执行时若输入: welcome you to beijing<回车>,则输出结果是
A.w,you,jing,o
B.welcome,you,jing,to
C.w,you,eeijing,u
D.w,xelcome,eeijing,u
-
下列程序的输出结果是()。 include<stdio.h> include<string.h> main() { char a[]="\n123\\"; printf("%d,%d\n",strlen(a),sizeof(a)); }
A.5,6
B.5,5
C.6,6
D.6,5
-
下列程序的输出结果是()。 include<stdio.h> main() { int i,S=0; for(i=1;i<10;i++)
下列程序的输出结果是()。 include<stdio.h> main() { int i,S=0; for(i=1;i<10;i++) if(!(i%2)&&!(i%3))s+=i; printf("%d\n",s); }
A.4
B.39
C.45
D.6
-
下列程序的输出结果是()。 include<stdio.h> main { int i; for(i=1;i<=10,i++) { if(
下列程序的输出结果是()。 include<stdio.h> main { int i; for(i=1;i<=10,i++) { if((i*i>=20)&&(i*i<=100)) break; } printf("%d\n",i*i; }
A.49
B.36
C.25
D.64
-
下列程序的输出结果是______。 include<stdio.h> main(); }
-
若下列程序执行后t的值为4,则执行时输入a,b的值范围是 include ”stdio.h” main() { int a, b,
若下列程序执行后t的值为4,则执行时输入a,b的值范围是 include ”stdio.h” main() { int a, b, s=1, t=1; scanf (”%d, %d”, &a, &b); if (a>0) s+=1; if (a>b) t+=s; else if(a==b) t=5; else t = 2*s; printf (”s=%d, t=%d\n”, s,t); }
-
下列程序的输出结果是()。include<stdio.h>main(){ int a=4;printf("%d\n",(a+=a-=a*A) );}
A.-8
B.14
C.0
D.-24
-
下列程序的输出结果是()。 include<stdio.h> int fun(int a) { int b=0; static int c=4:
下列程序的输出结果是()。 include<stdio.h> int fun(int a) { int b=0; static int c=4: a=c++:b++; return(a): main { int a=2,i,c; for(i=0:i<2;i++) c=f(a+1): printf("%d\n",c); }
A.4
B.7
C.6
D.5
-
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。 main {char a[20]="ABCD\oEFG\0",h[]="IJK"; strcat(a,b);printf("%s\n",a); ) 程序运行后的输出结果是()。
A.ABCDE\0FG\0IJK
B.ABCDIJK
C.IJK
D.EFGIJK
-
下列程序的输出结果是()。 include<stdio.h> int b=2: int func(int*a) { b+=*a;return b
下列程序的输出结果是()。 include<stdio.h> int b=2: int func(int*a) { b+=*a;return b;} main { int a=1,t=2; t+=func(&a): printf("%d\n",t); }
A.4
B.5
C.6
D.8
-
有以下程序 include<stdio.h>include<string.h>void fun(); } 程序运行后的输出结果是
A.012345
B.876543210
C.876543
D.012345678
-
输入c2470f ? <回车> 后,下列程序的输出结果是________。 include "stdio.h" int main()
输入c2470f ? <回车> 后,下列程序的输出结果是________。 include "stdio.h" int main() { char ch; long number=0; while((ch=getchar())<’0’||ch>’6’) ; while(ch!=’?’&&ch>=’0’&&ch<=’6’) { number="number*7+ch﹣’0’;" printf("%ld",number); ch="getchar();" } return 0;>
-
有以下程序 include<stdio.h> include<stdio.h> intfun()); } 程序的运行结果是10 B.20 C.0 D.出错
A.10
B.20
C.0
D.出错