i want to enter x1,x2 and y1,y2 and it displays the slope of the line...but there are some errors ,can anyone figure it out ?
#include<stdio.h>
#include<conio.h>
/* 2 point form*/
float findslope(float , float,float , float);
float m,n;
void main()
{
float a1,b1,a2,b2,;
double result
cout << "\n Enter in order x1,x2,y1,y2: ";
cin>>x1>x2>>y1>>y2>>\n;
result = findslope(x1,x2,y1,y2);
cout << result\n;
rr = y1 - result*x1;
cout<< "\nEquation:y - %fx = %f",result,rr);
getch();
}
float findslope(float a1,float a2,float b1, float b2)
{
float result;
result = b1 - b2;
result = result/(a1 - a2);
return(result);
}