could you help me? I am new in programming and in C++
#include <iostream>
#include <cmath>
#include <math.h>
#include <cstdio>
using namespace std;
double SSS(double a, double b, double c){
double bot1 = -2*b*c;
double bot2 = -2*c*a;
if(bot1==0.0 or bot2==0.0){
return 0.0;
}
double alpha = acos((a*a-b*b-c*c)/bot1);
const double rad = 0.5729577951308232088;
double beta = acos((b*b-c*c-a*a)/bot2);
return alpha*rad;
return beta*rad;
}
int main(){
cout << SSS(5, 7, 8)<<endl;
}
I would like to get a triangle angle in my window. I don't know where is an error..:(
You need cast int a, b,c to float.