Here's my code for finding the distance between two points. My assignment makes it mandatory to make use of functions, hence a separate one for finding the distance. I don't get any syntax errors but only a blinking cursor when I execute the code. I'm a beginner in C.

My code:

```
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
float distance(float *x1, float *y1, float *x2, float *y2);
int main()
{ printf("Input coordinates as x1,y1,x2,y2:\n");
float x1,y1,x2,y2;
scanf("%f %f %f %f ",&x1,&y1,&x2,&y2);
printf("Coordinates are : (%f,%f) and (%f,%f)\n",x1,y1,x2,y2);
printf("%f",distance (&x1,&y1,&x2,&y2));
return 0;
}
float distance(float *x1, float *y1, float *x2, float *y2)
{
float d= sqrt(pow((*x1-*x2),2)+pow((*y1-*y2),2));
printf("%f", d);
return d;
}
```

while compiling: gcc -o 1 1.c -lm output:

```
Input coordinates as x1,y1,x2,y2:
1 2 3 4
```

That's it. The cursor keeps blinking without providing any output.

Also, I tried putting in print statements at various points. Any print after the `scanf`

doesn't work.

`1 2 3 4`

? – pqnet Oct 22 at 5:45