/*************************************************
Distance between points
Write a program that readsin two points (x1,y1)
and (x2,y2) and prints out the distance between
the two points. Write and use a function
distance(x1,y1,x2,y2) to help you do this.
*************************************************/
**#include <iostream>**
**using** **namespace** std;
**double** distance(**double**,**double**,**double**,**double**);
**int** main()
**{**
// Get coordinates
**char** c;
**double** x1, y1, x2, y2;
cout << "Enter point 1: ";
cin >> c >> x1 >> c >> y1 >> c;
cout << "Enter point 2: ";
cin >> c >> x2 >> c >> y2 >> c;
// Write distance
cout << "The distance between the points is "
<< distance(x1,y1,x2,y2) << endl;
**return** 0;
**}**
/***********************************
** distance between two points
***********************************/
**double** distance(**double** x1, **double** y1, **double** x2, **double** y2)
**{**
**double** X = x1 - x2, Y = y1 - y2;
**return** sqrt(X*X + Y*Y);
**}**