以下程序运行结果______。#includeinta=3,b=5;intmax(inta,intb){intc;c=a>b?a:b;return(c);}intmain(){inta=8;printf("max=%d",max(a,b));}
举一反三
- 以下程序的运行结果是()#include<stdio.h>intfun(inta,intb,intc){c=a*b;}intmain(){intc;fun(2,3,c);printf("%d\n",c);return0;}
- 下列程序的运行结果是()。#include"stdio.h"intfun(inta,intb){intmax;if(a<b)max=b;elsemax=a;return(max);}main(){intx=7,y=9,z;z=fun(x,y);printf("%d",z);}
- 运行以下程序时,输出结果是______。#include<stdio.h>intf(inta){intb=0;staticintc=2;b++;c+=3;return(a+b+c);}intmain(){inta=1,i;for(i=0;i<=2;i++)printf("%4d",f(a));}
- 下列函数调用中,不正确的是() A: max(a,b); B: max(3,a+b); C: max(3,5); D: intmax(inta,intb);
- #includeintfun1(inta,intb,intc);intmain(){inta=11,b=21,c=31;fun1(a,b,c);printf("%d%d%d",a,b,c);return0;}intfun1(inta,intb,intc){a=a+10;b=b+10;c=c+10;returnc;} A: 112131 B: 211131 C: 113121 D: 312111