Program to calculate area of Circumcircle of an Equilateral Triangle

CServer Side ProgrammingProgramming

A circumcircle is a circle that inscribes a regular polygon inside it. The triangle that is inscribed inside a circle is an equilateral triangle. Area of circumcircle of can be found using the following formula,

Area of circumcircle = “(a * a * (丌 / 3))

Code Logic, The area of circumcircle of an equilateral triangle is found using the mathematical formula (a*a*(丌/3)). The value of 丌 in this code is coded as 3.14. The expression is evaluated into a float value.

Example

 Live Demo

#include <stdio.h>
#include <math.h>
int main(){
   int a = 5;
   float area;
   float pie = 3.14;
   printf("Program to calculate area of Circumcircle of an Equilateral Triangle\n");
   printf("The side of the triangle is %d \n", a);
   area = ((pie/3)*a*a);
   printf("The area of of Circumcircle of an Equilateral Triangle is %f \n", area);
   return 0;
}

Output

Program to calculate area of Circumcircle of an Equilateral Triangle
The side of the triangle is 5
The area of circle inscribed inside a square is 19.625000
raja
Published on 09-Jul-2019 10:49:46
Advertisements