I have to create a program that the user enters the input for three sides of a triangle and the output tells me whether it is a right triangle or not. The issue I'm having is that no matter the input, it tells me it is a right triangle. Here is my code.
#include <iostream>
#include <iomanip>
usingnamespace std;
int main(){
int a;
int b;
int c;
int hypo;
int opp;
int adj;
cout << "What is a or the opposite side?" << endl;
cin >> a;
cout << "What is b or the adjacent side?" << endl;
cin >> b;
cout << "What is c or the hypotenuse?" << endl;
cin >> c;
hypo = c*c;
opp = a*a;
adj = b*b;
if (hypo = opp + adj){
cout << "This is a right triangle." << endl;
}
else {
cout << "This is not a right triangle." << endl;
}
system("Pause");
return 0;
}