WHILE...WEND loop

 WHILE...WEND loop

WHILE...WEND loop is used when the number of repetitions is not known ahead of time. The loop continues to execute as long as a specified condition remains true. 
Syntax
WHILE condition
    ' Code block to be executed
WEND
Use code with caution.
  • WHILE: The keyword that begins the loop.
  • condition: The logical expression that is checked before each cycle. If it is true, the loop body executes.
  • WEND: The keyword that marks the end of the loop body.
     
Example
1. Program to display " First TEN natural number using WHILE - WEND loop.

2.  Program to display " First TEN ODD number using WHILE - WEND loop.

3.  Program to display " First TEN EVEN number using WHILE - WEND loop.

4.  Program to display " Multiplication table (constant number) using WHILE - WEND loop.


5.  Program to display " Multiplication table ( variable number) using WHILE - WEND loop.




No comments:

Post a Comment