<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/2019/02/c-program-to-find-the-largest-of-three-numbers-using-pointers/](https://beginnersbook.com/2019/02/c-program-to-find-the-largest-of-three-numbers-using-pointers/) 在本教程中,我們將編寫一個 C 程序,使用指針查找三個輸入數字中最大的一個。 ## 使用指針查找最大數字的程序 在下面的程序中,我們有三個整數`num1`,`num2`,`num3`。我們已將這三個數字的地址分別賦給三個指針`p1`,`p2`,`p3`。之后我們使用[`if else`語句](https://beginnersbook.com/2014/01/c-if-statement/)對存儲在指針指向的地址處的值進行了比較。 ```c #include <stdio.h> int main() { int num1, num2, num3; int *p1, *p2, *p3; //taking input from user printf("Enter First Number: "); scanf("%d",&num1); printf("Enter Second Number: "); scanf("%d",&num2); printf("Enter Third Number: "); scanf("%d",&num3); //assigning the address of input numbers to pointers p1 = &num1; p2 = &num2; p3 = &num3; if(*p1 > *p2) { if(*p1 > *p3) { printf("%d is the largest number", *p1); } else { printf("%d is the largest number", *p3); } } else { if(*p2 > *p3) { printf("%d is the largest number", *p2); } else { printf("%d is the largest number", *p3); } } return 0; } ``` **輸出:** ![C Program to Find the Largest of three numbers using Pointers](https://img.kancloud.cn/05/e7/05e7124e82310ba7ed8eef34b1807e94_826x240.jpg) #### 相關 C 示例 1. [C 程序:使用指針來統計字符串中的元音和輔音](https://beginnersbook.com/2019/02/c-program-to-count-vowels-and-consonants-in-a-string-using-pointer/) 2. [C 程序:使用指針打印字符串](https://beginnersbook.com/2019/02/c-program-to-print-string-using-pointer/) 3. [C 程序:使用指針交換兩個數字](https://beginnersbook.com/2019/02/c-program-to-swap-two-numbers-using-pointers/) 4. [C 程序:創建初始化并訪問指針變量](https://beginnersbook.com/2019/02/c-program-to-create-initialize-and-access-a-pointer-variable/) 5. [C 程序:查找最大的三個數字而不使用指針](https://beginnersbook.com/2014/06/c-program-to-find-greatest-of-three-numbers/)
                  <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>

                              哎呀哎呀视频在线观看