Lines 7-10. You do create four variables, but do not set their values. They are uninitialized. Value unknown. That, in itself is not an error.
Line 11. You calculate something from unknown values and store the unknown result in new variable s. Value unknown. A logical error.
Lines 13-19 you do finally set the values of the four variables (unless input fails). They do now have defined values, but s remains unknown. You should move line 11 to after line 19.
Line 20.
(y2-y1) is an expression that evaluates to a value. Similarly, the (s*(x2-x1)) evaluates to a value.
Then you have assignment =
Would it make sense to write
3.14 = 4.2;
? No. In assignment the value of the right side is stored into variable on the left side.
Your left side is not such a variable, or is it?
Both << and = are operators. Operators have precedence and order of evaluation.
For example:
1 2 3 4 5 6 7 8 9 10
|
cout << A << B;
// is same as
cout << A;
cout << B;
// but
A = B = C;
// is same as
B = C;
A = B;
|
Precedence says, which is evaluated first, << or =. That is where your error message is coming from.
The error points to syntax, but the real error is in the logic of the code.
What values do you want to calculate?
What values do you want to show?