Hi Lyrockzz!
Adrian is right, you need 4 arguments used by 'distance' in line 22.
erg1 is unused and can receive the return value of 'distance'
example:
Code:
#include <stdio.h>
#include <math.h>
//Distance funktion
double distance(double x1, double y1, double x2, double y2){
return sqrt(pow((x2-x1), 2) + pow((y2-y1), 2));
}
int main()
{
double x1,y1,x2,y2, erg1;
printf("x1 y1 x2 y2: ");
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
erg1 = distance(x1, y1, x2, y2);
printf("The distance is %lf", erg1);
return 0;
}
example for input and output on the screen:
x1 y1 x2 y2: 0 0 50 86.6025403
The distance is: 100.000000