Area of the circumcircle of any triangles with sides given | C ++ Program to find the area the circumcircle of the given triangle ; Function to find the area of the circumcircle ; the sides cannot be negative ; semi - perimeter of the circle ; area of triangle ; area of the circle ; Driver code ; Get the sides of the triangle ; Find and print the area of the circumcircle
#include <bits/stdc++.h> NEW_LINE using namespace std ; float circlearea ( float a , float b , float c ) { if ( a < 0 b < 0 c < 0 ) return -1 ; float p = ( a + b + c ) / 2 ; float At = sqrt ( p * ( p - a ) * ( p - b ) * ( p - c ) ) ; float A = 3.14 * pow ( ( ( a * b * c ) / ( 4 * At ) ) , 2 ) ; return A ; } int main ( ) { float a = 4 , b = 5 , c = 3 ; cout << circlearea ( a , b , c ) << endl ; return 0 ; }