´¹¤åºK

¹q¸£¤­°ê»y¨¥°ò¦4: While Loop

µ¹´¹·s»D¤@­ÓÆg




(®L»F¼Ý »s¹Ï)

§@ªÌ¡G®L»F¼Ý 2010-12-17 ªìª©

©MFor..Next ¤@¼Ë
·Q­«½Æ«ü¥O°µ«Ü¦h¦¸
²{¦b§ï¤@­Ó¤è¦¡
¥[¤@­Ó§PÂ_¦¡
¥u­n§PÂ_¦¡¬°¯u´N­«½Æ°õ¦æ
¦b BASIC ¤¤
¥H "While §PÂ_¦¡ ....WEnd ªí¥Ü"
§¨¦b¤¤¶¡ªº´N¬O·|­«½Æ°õ¦æªº«ü¥O


BASIC:
        ' *******************************************
        ' while loop statement
        ' *******************************************
        Sub WhileLoop()
            Dim i as Integer
            Debug.Print " ";"**** While statement ***";
            Debug.Print
            i=1
            While (i<=5)
                Debug.Print " ";"i=";
                Debug.Print " ";i;
                Debug.Print
                i=i+1
            WEnd
        End Sub
   
C++:
        /* ******************************************* */
        /* while loop statement  */
        /* ******************************************* */
        void WhileLoop() {
            int i;
            printf(" %s" , "**** While statement ***");
            printf("\n" );
            i=1;
            while (i<=5) {
                printf(" %s" , "i=");
                printf(" %d" , i);
                printf("\n" );
                i=i+1;
            }
        }

JAVA:
        // *******************************************
        // while loop statement
        // *******************************************
        public void WhileLoop()  {
            int i;
            System.out.print(" "+"**** While statement ***" );
            System.out.println("");
            i=1;
            while (i<=5) {
                System.out.print(" "+"i=" );
                System.out.print(" "+i );
                System.out.println("");
                i=i+1;
            }
        }
   
C#:
        /* ******************************************* */
        /* while loop statement */
        /* ******************************************* */
        public void WhileLoop()  {
            int i;
            Console.Write(" "+"**** While statement ***");
            Console.WriteLine("");
            i=1;
            while (i<=5) {
                Console.Write(" "+"i=");
                Console.Write(" "+i);
                Console.WriteLine("");
                i=i+1;
            }
        }
   
PHP:
        /* ******************************************* */
        /* while loop statement */
        /* ******************************************* */
        function WhileLoop()  {
            echo " "."**** While statement ***";
            echo "";
            $i=1;
            while ($i<=5) {
                echo " "."i=";
                echo " ".$i;
                echo "";
                $i=$i+1;
            }
        }