fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. typedef struct {
  6. int x;
  7. int y;
  8. } point;
  9.  
  10. point a = {3, 2};
  11. point b = {5, 7};
  12.  
  13. double distance(point a, point b)
  14. {
  15. return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));
  16. }
  17.  
  18. printf("distance = %f", distance(a, b));
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
distance = 5.385165