# Distance Between Two Points

*Adapted by Neilor Tonin, URI Brazil | Timelimit: 1*

Read the four values corresponding to the x and y axes of two points in the plane, p1 (x1, y1) and p2 (x2, y2) and calculate the distance between them, showing four decimal places after the comma, according to the formula:

Distance =

## Input

The input file contains two lines of data. The first one contains two double values: * x1 y1* and the second one also contains two double values with one digit after the decimal point:

*.*

**x2 y2**## Output

Calculate and print the distance value using the provided formula, with 4 digits after the decimal point.

Input Sample | Output Sample |

1.0 7.0 5.0 9.0 | 4.4721 |

-2.5 0.4 12.1 7.3 | 16.1484 |

2.5 -0.4 -12.2 7.0 | 16.4575 |

**Solution**

```
#include <stdio.h>
#include<math.h>
int main()
{
double x1,y1,x2,y2,p;
scanf("%lf %lf",&x1,&y1);
scanf("%lf %lf",&x2,&y2);
p=sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));
printf("%.4lf\n",p);
return 0;
}
```

- URI 2694 Solved by C programming
- URI Online Solve | 1957 Converting to Hexadecimal- Solution
- Android custom toolbar Android Studio | Android Tutorial
- URI Online Judge | 1040 Solution | Average 3
- URI Online Judge | 1038 Solution |Snack
- URI Online Judge | 1037 Solution | Interval
- URI Online Judge | 1036 Solution | Bhaskara’s Formula
- URI Online Judge Solution| 1035 Selection Test 1
- URI Online Judge Solution| 1021 Banknotes and Coins
- URI Online Judge Solution| 1020 Age in Days
- URI Online Judge Solution| 1019 Time Conversion
- URI Online Judge Solution| 1018 Banknotes
- URI Online Judge Solution| 1017 Fuel Spent
- URI Online Judge Solution| 1016 Distance
- URI Online Judge Solution| 1015 Distance Between Two Points

F*ckin’ amazing things here. I’m very happy to peer your article. Thanks a lot and i am having a look forward to contact you. Will you please drop me a mail?

??

This design is steller! You definitely know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job. I really loved what you had to say, and more than that, how you presented it. Too cool!

Wow, wonderful blog layout! How long have you been blogging for?

you made blogging look easy. The overall look of your web site

is excellent, as well as the content! adreamoftrains web hosting

Hi there, just became alert to your blog through Google, and found

that it is really informative. I’m going to watch out for brussels.

I’ll be grateful if you continue this in future. A lot of people will be benefited

from your writing. Cheers!