fork download
  1. program distance_between_points
  2. implicit none
  3. real::x1,x2,y1,y2,distance
  4. print *,'Enter the coordinates of the first point(x1,y1):'
  5. read *,x1,y1
  6. print *,'Enter the coordinates of the second points(x2,y2):'
  7. read *,x2,y2
  8. distance=sqrt((x2-x1)**2+(y2-y1)**2)
  9. print *,'The distance between the points is:',distance
  10. end program distance_between_points
Success #stdin #stdout 0.01s 5244KB
stdin
4
5
2
4
stdout
 Enter the coordinates of the first point(x1,y1):
 Enter the  coordinates of the second points(x2,y2):
 The distance between the points is:   2.23606801