下列程序的运行结果是( )。
#include<stdio.h>
main()
{ int a=2,b=3,c=4;
ifa<B)
if(b<0)c=0;
else c+=1;
printf("%d\n",C) ;
}
A.2
B.3
C.5
D.4
第1题:
下列程序的运行结果是( )。 #include <stdio.h> main() { int a=2,b=3,c=4; if(a<b) if(b<0) c=0; else c+=1; printf("%d\n", c); }
A.2
B.3
C.5
D.4
第2题:
有以下程序,程序执行后,输出结果是【 】
include<stdio.h>
void fun(int*A)
{ a[0]=a[1];}
main()
{ int a[10]={10,9,8,7,6,5,4,3,2,1,},i;
for(i=2;i>1=0;i-) fun(&a[i]);
for(i=0;i<10;i++) printf("%d,a[i]);
printf("\n");
}
第3题:
下列程序的运行结果是( )。 #include<stdio.h> main() { int a=2,b=3,c=4; if(a<B) if(b<0) c=0; else c+=1; printf("%d\n",C) ; }
A.2
B.3
C.5
D.4
第4题:
若有以下程序 #include <stdio.h> int a[]={2,4,6,8}; main() { int i; int *p=a; for(i=0;i<4;i++)a[i]=*p; printf("%d\n",a[2]);} 上面程序输出结果是
A.6
B.8
C.4
D.2
第5题:
下列程序的运行结果是( )。 #include<stdio.h> void sub(int*s,int*y) {static int m=4: *y=s[m]; m--; } void main() {int a[]={1,2,3,4,5},k,x; printf("\n"); for(k=0;k<=4;k++) {sub(a,&x); printf("%d,",x); } }
A.5,4,3,2,1,
B.1,2,3,4,5,
C.0,0,0,0,0,
D.4,4,4,4,4,