用於計算等邊三角形外切圓面積的程式


外切圓是將正多邊形內切於其中的圓。內切於圓中的三角形是等邊三角形。外切圓的面積可以使用以下公式計算:

外切圓面積 = “(a * a * (丌 / 3))

程式碼邏輯,等邊三角形外切圓的面積是使用數學公式 (a*a*(丌/3)) 計算的。此程式碼中 丌 的值為 3.14。表示式計算為浮點數。

示例

 線上演示

#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
");    printf("The side of the triangle is %d
", a);    area = ((pie/3)*a*a);    printf("The area of of Circumcircle of an Equilateral Triangle is %f
", area);    return 0; }

輸出

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

更新於: 30-7 月-2019

198 次瀏覽

開啟 職業生涯

透過完成課程獲得認證

開始
廣告