hello,
I'm new with c programming and...
I'm trying to program a function which should perform the mathematical ditstance formula
but I 'm getting this error: found '{' at file scope (missing function header?
this is the code that I wrote
what do I do wrong?Code:#include <stdio.h> #include <math.h> float distance(float x1, float x2, float y1, float y2); { float a=0 ,b=0 ,c=0, d=0 e=0; a= x2 -x1; b= y2 -y1; c = pow(a,2); d = pow(b,2); c+d=e return sqrt(e); } int main() { x1=2; x2=4; y1=3; y2=6; printf("%lf\n",distance(x1,x2,y1,y2); return 0; }
thenks for helping..![]()



LinkBack URL
About LinkBacks




