//----------------------------------------------------------------
//This program will find the length of a line on a plane. With the
//one end at the origin and the other end selected by the user and
//print it to screen.
# include <math.h>
# include <stdlib.h>
# include <iomanip.h>
# include <iostream.h>
int main()
{
//Define constants, variables, and prototypes.
double length(double x, double y);
double x_in,y_in;
//Have user enter values for x and y.
cout << " Enter in the values for x and y. " <<endl;
cout << " Enter x value." <<endl;
cin >> x_in;
cout << " Enter y value." <<endl;
cin >> y_in;
//Print anwser to screen.
cout << "The length of the line is equal to " << length <<"."<<endl;
//Exit program.
return 0;
}
//-----------------------------------------------------------------
//This function evaluates the length of the line.
//
double length(double x, double y);
*{
sqrt(pow(x_in,2)+pow(y-in,2));
return length;
}
//-----------------------------------------------------------------
The astric is where the program has the error. What is wrong?