#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float ab, bc, ac;
cout << "Enter BC - adjacent side: \n" ;
cin >> bc;
cout << "Enter AC - opposite side: \n" ;
cin >> ac;
cout << "Enter AB - hypotenuse: \n" ;
cin >> ab;
if(pow(bc,2)+pow(ac,2)!=pow(ab,2)){
cout << "This is not a right angled triangle!!!\n";
}
else{
cout << "cosine of BAC angle is " << bc/ab << "\n";
cout << "sine of BAC angle is " << ac/ab << "\n";
cout << "tangent of BAC angle is " << bc/ac << "\n";
}
return 0;
}
Comments
Leave a comment