Stores the numerator and the denominator to find angle A
double numerator = a * a + d * d - b * b - c * c ; double denominator = 2 * ( a * b + c * d ) ; double x = numerator / denominator ; cout << fixed << setprecision ( 2 ) << " A : ▁ " << ( acos ( x ) * 180 ) / 3.141592 << " ▁ degrees " ;