I want to call a function to calculate Pythagoras and to see whether it is true that a triangle is a right angled triangle using three inputs. I am very new to C++ and will appreciate help with this:
This is my code, it runs but does not work correctly:
#include <iostream>
#include <cmath>
using namespace std;
double pythagorusTheorem(double a, double b, double c);
int main(){
double a;
double b;
double c;
cout << "Write the three sides of the triangle, enter biggest first and shorter sides after: " << endl;
cin >> a >> b >> c;
if (double val=pythagorusTheorem(a,b,c) == true){
cout << "This is a right-angle triangle " << endl;
}
if (double val=pythagorusTheorem(a,b,c) == false) {
cout << "This is not a right angled triangle " << endl;
}
return 0;
}
double pythagorusTheorem(double a, double b, double c){
a = pow(b,2) + pow(c,2);
}