Question: Write a program that calculates the distance between two points in a Cartesian coordinate system. Input Format Input will be in the form: X1 Y1

Write a program that calculates the distance between two points in a Cartesian coordinate system.

Input Format Input will be in the form:

X1 Y1 X2 Y2

Where:

(X1, Y1) = Coordinates of the first point.

(X2, Y2) = Coordinates of the second point.

Output Format

Your output should be rounded to the nearest two decimals places

Sample 1:

Input 0 0 2 2

Output 2.83

Sample 2:

Input 1 10 15 20 Output 17.20

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!