下列函数在 n 个元素的一维数组中,找出最大值、最小值并传送到调用函数,请填空。#include void find(float *p, float *max, float *min, int n){int k;____*max=*p; ____for(k=1;k
查看答案
3. 写出下列程序运行结果:(1)main(){int i=1,p;p=fun(i,i+1);printf("%d\n",p);}int fun(int a,int b){int f;if(a>b)f=1;else if(a==b)f=0;elsef=-1;return f;}
3. 写出下列程序运行结果:(2)键盘输入 abcdef#include void fun( ){char c ;if((c=getchar( ))!='\n')fun( ) ;putchar(c);}void main( ){ fun( ); }
3. 写出下列程序运行结果:#include int c , a=4 ;func(int a , int b){ c=a*b ; a=b-1 ; b++ ; return (a+b+1) ; }void main( ){int b=2 , p=0 ; c=1 ;p=func(b , a) ;printf("%d,%d,%d,%d\n", a,b,c,p) ;}
3. 写出下列程序运行结果:unsigned fun6(unsigned num){unsigned k=1;do { k*=num%10; num/=10; }while(num);return k;}void main( ){unsigned n=26;printf("%d\n", fun6(n));}