Basic HTML Version

|  | Table of Contents |  | View Full Version

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

    Restart

                           Looping statements are very useful and necessary for developing an application.
                           The FOR...NEXT statement is used to run a code a fixed number of times.
                           WHILE…END...WHILE loop is used when we do not know the loop count.
                           A loop which never ends is called infinite loop.
                           The PAUSE statement is used to temporarily stop the program.
                           Nesting loops means placing one loop inside another

                                                              Checkpoint

                     A.  Tick ( ) the correct option.

                        1.  Which loop statement do we use when we don't know the loop count?
                           a.  WHILE                                        b.  FOR

                           c.  Both a and b                                 d.  None of these

                        2.  In BASIC-256, the statements used for repetition of instructions in a program are called:

                           a.  Conditional statements                       b.  Iterative statements
                           c.  Assignment statements                        d.  Input statements

                        3.  In the given statement, what is i?

                           FOR i = 1 TO 100
                           a.  BRANCH                                       b.  Counter variable

                           c.  CONDITION                                    d.  Property

                        4.  What does the PAUSE statement do in BASIC-256?

                           a.  Stops the program                            b.  Waits for a key press

                           c.  Delays for seconds                           d.  Resumes automatically

                        5.  What will be the output of the following program?
                           FOR I = 10 TO 1 STEP - 4

                           PRINT I;
                           NEXT I
                           END

                           a.  1062                                         b.  2610

                           c.  856                                          d.  10

                                                                         Looping Control Statements in BASIC-256        109

| 106 107 108 109 110 111 112 113 114 115 116 |