<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # C 程序:將兩個浮點數相乘 > 原文: [https://www.programiz.com/c-programming/examples/product-numbers](https://www.programiz.com/c-programming/examples/product-numbers) #### 在此示例中,計算用戶輸入的兩個浮點數的乘積并將其打印在屏幕上。 要理解此示例,您應該了解以下 [C 編程](/c-programming "C tutorial")主題: * [C 變量,常量和字面值](/c-programming/c-variables-constants) * [C 數據類型](/c-programming/c-data-types) * [C 輸入輸出(I/O)](/c-programming/c-input-output) * [C 編程運算符](/c-programming/c-operators) * * * ## 將兩個數字相乘的程序 ```c #include <stdio.h> int main() { double a, b, product; printf("Enter two numbers: "); scanf("%lf %lf", &a, &b); // Calculating product product = a * b; // Result up to 2 decimal point is displayed using %.2lf printf("Product = %.2lf", product); return 0; } ``` **輸出** ```c Enter two numbers: 2.4 1.12 Product = 2.69 ``` * * * 在該程序中,要求用戶輸入兩個數字,分別存儲在變量`a`和`b`中。 ```c printf("Enter two numbers: "); scanf("%lf %lf", &a, &b); ``` 然后,求值`a`和`b`的乘積,并將結果存儲在`product`中。 ```c product = a * b; ``` 最后,使用`printf()`在屏幕上顯示`product`。 ```c printf("Product = %.2lf", product); ``` 注意,結果使用`%.2lf`轉換字符四舍五入到小數點后第二位。
                  <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>

                              哎呀哎呀视频在线观看