Question: Using C++ Complete the following program that computes the distance between points (x1, y1) and (x2, y2). According to the Pythagorean theorem, the distance is
Using C++
Complete the following program that computes the distance between points (x1, y1) and (x2, y2). According to the Pythagorean theorem, the distance is ((x_2-x_1)+(y_2-y_1))
#include
#include
using namespace std;
int main()
{
double x1;
double y1;
double x2;
double y2;
cin >> x1;
cin >> y1;
cin >> x2;
cin >> y2;
/* Your code goes here */
cout << "Distance: " << distance << endl;
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
