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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # C 程序:將八進制數轉換為十進制數 > 原文: [https://beginnersbook.com/2017/09/c-program-to-convert-octal-number-to-decimal-number/](https://beginnersbook.com/2017/09/c-program-to-convert-octal-number-to-decimal-number/) 該程序將八進制數轉換為等效的十進制數。 ## 示例:將八進制轉換為十進制的程序 在這個程序中,我們為八進制到十進制轉換創建了一個用戶定義的函數。程序將八進制數(由用戶輸入)作為輸入,并使用函數將其轉換為十進制數。要了解此程序,您應該具有以下 [C 編程](https://beginnersbook.com/2014/01/c-tutorial-for-beginners-with-examples/)主題的知識: 1. [C - 用戶自定義函數](https://beginnersbook.com/2014/01/c-functions-examples/) 2. [C `while`循環](https://beginnersbook.com/2014/01/c-while-loop/) ```c #include <stdio.h> #include <math.h> /* This function converts the octal number "octalnum" to the * decimal number and returns it. */ long octalToDecimal(int octalnum) { int decimalnum = 0, temp = 0; while(octalnum != 0) { decimalnum = decimalnum + (octalnum%10) * pow(8,temp); temp++; octalnum = octalnum / 10; } return decimalnum; } int main() { int octalnum; printf("Enter an octal number: "); scanf("%d", &octalnum); printf("Equivalent decimal number is: %ld", octalToDecimal(octalnum)); return 0; } ``` 輸出: ```c Enter an octal number: 754 Equivalent decimal number is: 492 ``` 看看這些相關的 C 程序: 1. [C 程序:將八進制轉換為二進制](https://beginnersbook.com/2017/09/c-program-to-convert-octal-number-to-binary-number/) 2. [C 程序:將二進制轉換為八進制](https://beginnersbook.com/2017/09/c-program-to-convert-binary-to-octal-number-system/) 3. [C 程序:將二進制轉換為十進制](https://beginnersbook.com/2015/02/c-program-to-convert-binary-number-to-decimal-number/) 4. [C 程序:將小寫字符串轉換為大寫](https://beginnersbook.com/2015/02/c-program-to-convert-lowercase-string-to-uppercase-string/) 5. [C 程序:將大寫字符串轉換為小寫](https://beginnersbook.com/2015/02/c-program-to-convert-uppercase-string-to-lowercase-string/)
                  <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>

                              哎呀哎呀视频在线观看