有以下程序:
#include<stdio.h>
main( )
{ int a=1,b=0;
if(--a)b++;
else if(a==0)b+=2;
else b+=3:
print[("%d\n",b);
}
程序运行后的输出结果是( )。
A.0
B.1
C.2
D.3
第1题:
有以下程序,程序执行后,输出结果是【 】
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");
}
第2题:
有以下程序
#include<stdio.h>
main( )
{int a=1,b=0
if(!a)b++;
else if(a==0)if(a)b+=2
else b+=3
printf(”%d\n”,b);
}
程序运行后的输出结果是( )。
A.0
B.1
C.2
D.3
第3题:
【单选题】以下程序的运行后的输出结果是_______。 #inlude <stdio.h> main() { int a=1,b=0; if(--a) b++; else if(a==0) b+=2; else b+=3; printf("%dn",b); }
A.0
B.1
C.2
D.3
第4题:
有以下程序
#include<stdio.h>
main()
{ int a=1,b=0;
if(--a)b++;
else if(a==0) b+=2;
else b+=3:
printf("%d\n",b);
}
程序运行后的输出结果是
A.0
B.1
C.2
D.3
第5题:
试题18
有以下程序
#include <stdio.h>
main()
{ int a=1,b=0;
if(- -a) b++;
else if(a= =0) b+=2;
else b==3;
printf(“%d\n”, b);
}
程序运行后的输出结果是()
A.0
B.1
C.2
D.3