Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 107 - 2505_CoreGPT(Podar)_Flipbook_C7
P. 107

    Sample Programs using While…END...WHILE Statement

                     Program 1: To print the numbers from 1 to 5.

                     Program 2: To print a table of the number entered by the user.

                           INFINITE LOOP

                     A  loop  which  never  ends  is  called  infinite  loop.  We  should  avoid  such  conditions  while
                     programming. If a while loop condition does not become false, the loop runs for ever, creating
                     an infinite loop. Press the Stop button on the Main toolbar to end the infinite loop.

                     Example 1:

                     number = 1
                     WHILE (number < 10)

                     PRINT number

                     END WHILE

                                                                         Looping Control Statements in BASIC-256        105

| 102 103 104 105 106 107 108 109 110 111 112 |