I don't think here is any Formulas error but here it is.
So please correct the Error int this Program.
Problem is in this lines [cout<< "Line wil travel more along X-axis & less along Y-axis";
if (resultSlope>1);
cout<< "Line wil travel more along Y-axis & less along X-axis";
{
cout<<"Press any Key to continue....";]
#include <iostream>
#include <conio.h>
using namespace std;
// Main Function
int main()
{
int y1,y2,x1,x2;
double resultSlope;
cout << "Enter the X-Coordinate of the starting point = ";
cin >> x1;
cout <<"Enter the Y-Coordinate of the starting point = ";
cin >> y1;
cout << "Enter The X-Coordinate of the Ending point = ";
cin >> x2;
cout << "Enter the Y-Coordinate of the Ending Point = ";
cin >> y2;
resultSlope =(y2-y1)/(x2-x1);
if (resultSlope<1);
cout<< "Line wil travel more along X-axis & less along Y-axis";
if (resultSlope>1);
cout<< "Line wil travel more along Y-axis & less along X-axis";
{
cout<<"Press any Key to continue....";
getch();
}
}