<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # C 程序:計算等邊三角形的面積 > 原文: [https://beginnersbook.com/2014/06/c-program-to-calculate-area-of-equilatral-triangle/](https://beginnersbook.com/2014/06/c-program-to-calculate-area-of-equilatral-triangle/) 等邊三角形具有相等的邊(所有三邊相等)。在本教程中,我們共享了一個 C 程序,它將三角形邊作為輸入,將區域計算和顯示為輸出。 ## 計算面積的程序 為了計算等邊三角形的面積,我們必須知道三角形的邊。該程序將提示用戶進入等邊三角形的一邊,并根據該值計算面積。 **程序中使用的公式**: `Area = sqrt(3)/4 * side * side` 這里`sqrt`表示“平方根”,這是`math.h`頭文件的預定義函數。為了使用這個函數,我們在程序中包含了`math.h`頭文件。 ```c #include<stdio.h> #include<math.h> int main() { int triangle_side; float triangle_area, temp_variable; //Ask user to input the length of the side printf("\nEnter the Side of the triangle:"); scanf("%d",&triangle_side); //Caluclate and display area of Equilateral Triangle temp_variable = sqrt(3) / 4 ; triangle_area = temp_variable * triangle_side * triangle_side ; printf("\nArea of Equilateral Triangle is: %f",triangle_area); return(0); } ``` 輸出: ```c Enter the Side of the triangle: 2 Area of Equilateral Triangle is: 1.732051 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看