MeetCode
Distance Between Two Points
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Distance Between Two Points
Easy
Computer Mathematics
Geometry
20 views
Explanation
Complexity
Problem Statement
Compute Euclidean distance between two points (x1,y1),(x2,y2) with 2 decimals.
Input Format
Four numbers x1 y1 x2 y2.
Output Format
One number.
Example
Input
0 0 3 4
Output
5.00
Constraints
|coords|
Input / Output Format
Input Format
Four numbers x1 y1 x2 y2.
Output Format
One number.
Constraints
|coords|
Examples
Input:
0 0 3 4
Output:
5.00
Example Solution (Public)
Computer Mathematics
Distance = sqrt((x2-x1)^2+(y2-y1)^2). Print with 2 decimals.
Official Solution Code
Wrap
Copy
Distance = sqrt((x2-x1)^2+(y2-y1)^2). Print with 2 decimals.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
0 0 3 4
Expected Output
5.00
Compile Output
Error
Output
Please
login
to submit solutions.