// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ;

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 17:16:12
// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ;

// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ;
// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ;

// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ;
//
void fun( float y ,float x[],)
{
x[0] = x[1] + x[2];
y = y + x[3] ;
}
楼主的函数的错误分析
1." float x[],"里面的标点符号有错;
2.没有返回值,计算解决y是形参,并不能作为结果参数传出来.
3.float x[] ;其实等价于float * x;指针的话,应该注意范围越界的问题.

// void fun( float y ,float x[],) { x[0] = x[1] + x[2]; y = y + x[3] ; 阅读下列程序,写出运行后的结果.#include stdio.hfloat fun(float f){ return f*f; }void main(){ float k; k=fun(10.0); printf(%f ,k);} 阅读下列程序,写出运行后的结果.#include stdio.hfloat fun(float f){ return f*f; }void main(){ float k; k=fun(10.0); printf(%f ,k);} 请问 以下C/C++程序的具体意思是?#include #include void fft(float *xr, float *xi, int nr, float T);void main ( ){ float p[512],x[512],y[512]; int i,j; FILE *fp1,*fp2,*fp3; ////void fft(float *xr, float *xi, int nr, float T){ int 以下函数值的类型是 fun ( float x ) { float y; y= 3*x-4; return y; } 以下函数值的类型是( ).fun ( float x ) { float y; y= 3*x-4; return y; } 以下函数值的类型是fun ( float x ){ float y;y= 3*x-4;return y;} fun(float x) { float y; y=3*x-4; return y; }以上函数值的类型为什么是int?怎么不是float呢? #include void main( ) { float x,y; scanf(%f,&x); if(x #include void main( ) { float x,y; scanf(%f,&x); if(x 计算数学表达式#include #define FUN(m) (m*m+4.5*m-2.3)/(m-3.5)void main(){ /**/ float x,y,z; /**/ printf( Please input x(3.5),y(3.5),z(3.5): ); scanf(%f%f%f,&x,&y,&z); if(x==3.5 || y==3.5 || z==3.5) { printf(divide 0,error!); c语言用梯形法求积分#include float integral(float(*fun)(float x),float a,float b,int,n) {float s,h,y; int i; s=(fun(a)+fun(b))/2; h=(b-a)/n; for(i=1;i (30)设函数fun的定义形式为 void fun(char ch,float x ) { … } 则以下对函数fun的调用语句中,正确的是 A)fun(abc,3.0); B)t=fun('D',16.5); C)fun('65',2.8); D)fun(32,32);为什么不是B or 而是DB中函数为什么 C语言以下这题选什么?为什么?设函数fun的定义形式为void fun(char ch,float x) { … }则以下对函数fun 的调用语句中,正确的是( ).A)fun(abc,3.0); B)t=fun(‘D’,16.5); C)fun(‘65’,2.8); D)fun(32,32); 拉格朗日插值函数程序如下,divided by o 那地方错了啊,#include #include #include float loggerangri(int n,float *x,float *f,float X);void main() {int i;int m;float x[20];float y[20];float X,Px;printf( 请输入插值次数N );scanf( 请问以下函数值的类型fun(float x){float y;y=3*x-4;return y;}书上的答案是int型的,请问是为什么? c语言的问题,求x^3-5x^2+16x-80的根,我用的弦截法,但是出错#include#includefloat f(float x){float y;y=x*(x*x-5*x+16)-80;return y;}float xpoint(float x1,float x2){float root;root=(f(x2)*x1-x2*f(x1))/(f(x2)-f(x1));return root;}void main() #include #include int main(void) { float a,b,c,x,y,z; printf(please input a,b and