error C2106: '=' : left operand must be l-value

How do i fix that error on line 29 in bold letters?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<iostream>
#include<cmath>
#include<fstream>



using namespace std;
int main()
	
{
    
	
	double a,b,c;
	double area;
        double s;
	char repeat ;
	
	cout << "Enter side a of your tirangle: ";
	cin  >> a;
	cout << "Enter side b of your trialgle: ";
	cin  >> b;
	cout << "Enter side c of your triangle: ";
	cin  >> c;
	
        s = (a + b + c)/2;
	area = sqrt(s*(s-a)*(s-b)*(s-c));
	cout <<" Semiperimeter: " << s << endl;
	cout << " Area: " << area << endl;
	if (pow(c,2)= pow(a,2)+pow(b,2))
	  cout << " Your triangle is a right triangle"<< endl;
	else 
	  cout <<"Your triangle is not a right triangle"<< endl;
	
I think you meant

if (pow(c,2) == pow(a,2)+pow(b,2))

instead of

if (pow(c,2)= pow(a,2)+pow(b,2))
Last edited on
== ?

= for assignment
Last edited on
thank you but why do I need == instead of = ?
Last edited on
We do not need. It is you who need.:)
Topic archived. No new replies allowed.