Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  Simple Joys of Life 

What is nested loop?

What is Nested Loop? Define Nested Loop. Nested Loop Definition.
  • A nested loop is a loop which is itself inside another loop. There is an inner loop withing the body of an outer loop.
  • For example:
    • CLS
      FOR i = 1 TO 5
          FOR j = 1 TO 3
              PRINT j;
          NEXT j
          PRINT
      NEXT i
      END
  •  Rule for nested loop.
    •  An outer loop and inner loop cannot have the same control variable.
    • The inner loop must terminate before the outer loop.
    • The inner loop must be completely nested inside the body of the outer loop.
    • Outer loop is opened at first and closed at last.

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.