Basic HTML Version

|  | Table of Contents |  | View Full Version

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

    The above program will never end as the value of number is always 1, which is less than 10. So,
                      the loop will execute infinite times.

                      Example 2:

                      WHILE (True)
                      PRINT "Loop Never Ends"

                      END WHILE

                            PAUSE STATEMENT

                      The PAUSE statement is used to temporarily stop the program. When the PAUSE statement is
                      used, the program waits for the user to press any key before it continues. This can be useful when
                      you want to give the user time to read a message or to pause the program at a specific point.
                      The basic syntax of the pause statement is as follows:

                      PAUSE seconds

                      Sample Programs using Pause Statement

                      Program 1: To print a countdown from 5 to 1 with a pause of 1 second between each number.

                      Program 2: To print the word "HELLO" five times, flashing on and off every second.

                    106     Premium Edition-VII

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