10、以下程序的运行结果是( )#include <;stdio.h>;void main(){ int a=1,b=2,c;c=max(a,b);printf(“max is %d\n”,c);}max(int x, int y){ int z;z=(x>;y)? x:y;return(z);}
A: max is 2
B: max is 1
C: max is 3
D: max is 12
A: max is 2
B: max is 1
C: max is 3
D: max is 12
举一反三
- 有如下程序:#include"stdio.h"int max(x,y)int x,y;{int z;if(x>;y) z=x;else z=y;return(z);}main(){extern int a,b;printf(”max=%d\n",max(a,b));}int a=3,b=5;运行结果为( )。 A: max=3 B: max=4 C: max=5 D: max=6
- #include "stdio.h" int main() { int x,y, (1) ; scanf("%d%d%d", &x,&y,&z); if(x>=y) (2) ; (3) max=y; if( (4) ) max=z; printf("%d\n",max); }
- 下面正确的是() #include <stdio.h> int main() { int max(int x,int y); int a,b,c; scanf("%d,%d",&a,&b); c=max(a,b); printf("max=%d ",c); return 0; } int max(intx,inty); { int z; if(x>y)z=x; else z=y; return(z); }
- 有如下程序#include [iostream] using namespace std; int max(int x,int y) { int z; if(x>y) z=x; else z=y; return z; } int main() { int a=3,b=5; cout<<"max="<<max(a,b)<<endl; } A: max=3 B: max=4 C: max=5 D: max=6
- #include void main() { int max(flaot x, float y); float a, b; int c; scanf(“%f,%f”, &a, &b); c=max(a, b); printf(“Max is %d”, c);} int max(float x, float y) { float z; z = x > y ? x : y; return z;} 函数max的返回值是什么数据类型( )