单项选择题

有以下程序: #include <stdio.h> int fun(int x, int y) { if(x!=y) return ((x+y)/2); else return(x); } main() { int a=4, b=5, c=6; printf("%d\n", fun(2*a, fun(b, c))); 程序运行后的输出结果是______。

A.6
B.3
C.8
D.12
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序:#include <stdio.h>main(){ int a[]={2, 3, 5, 4}, i;for(i=0; i<4; i++)switch(i%2){ case 0: switch(a[i]%2){ case 0: a[i]++; break;case 1: a[i]--;} break;case 1: a[i]=0;}for(i=0; i<4; i++)printf( %d , a[i]); printf( n );}程序运行后的输出结果是______。
A.0 3 0 4
B.2 0 5 0
C.3 3 4 4
D.3 0 4 0
单项选择题
有以下程序:#include <stdio.h>main(){ int y=9;for(;y>0; y--)if(y%3==0) printf( %d , --y);}程序的运行结果是______。
A.852
B.963
C.741
D.875421
相关试题
  • 以下叙述中正确的是______。
  • 有以下程序:#include <stdio.h>main...
  • 以下叙述中错误的是______。
  • 有以下程序:#include <stdio.h>#inc...
  • 有以下程序:#include <stdio.h>struc...