FEDT Presentation GGS INDRAPRASTH UNIVERSITY Submitted to Submitted M BCA E1 201
Topic DO WHILE LOOP 12/26/03AVL Trees - Lecture 8
 Visual Basic loop structures allow to run one or more lines of code repetitively  Statements in a loop structure can be repeated Until a condition is True Until a condition is False A specified number of times, or Once for each element in a collection
Types of Looping: There are mainly 3 types of loop: For Loop While Loop Do Loop 12/26/03AVL Trees - Lecture 8
 One of the Do Loop statements variations is the Do While and it executes as long as a condition is true (while a particular condition is true).  Loop will get stops when condition is False.  Exit DO can be use to exit from loop anytime. Syntax:- Do {While} condition      statements [Exit Do]      statements Loop
Example of Do While Print Table Module Module1 Sub Main() Dim a, i As Integer a = 1 console.writeline("Enter the number") i =Console.ReadLine() Do While a < 10 a = a + 1 Console.WriteLine(a * i) Loop Console.ReadKey() End Sub End Module
THANK YOU

Do,Do while loop .net Visual Basic

  • 1.
    FEDT Presentation GGS INDRAPRASTHUNIVERSITY Submitted to Submitted M BCA E1 201
  • 2.
  • 3.
     Visual Basicloop structures allow to run one or more lines of code repetitively  Statements in a loop structure can be repeated Until a condition is True Until a condition is False A specified number of times, or Once for each element in a collection
  • 4.
    Types of Looping: Thereare mainly 3 types of loop: For Loop While Loop Do Loop 12/26/03AVL Trees - Lecture 8
  • 5.
     One ofthe Do Loop statements variations is the Do While and it executes as long as a condition is true (while a particular condition is true).  Loop will get stops when condition is False.  Exit DO can be use to exit from loop anytime. Syntax:- Do {While} condition      statements [Exit Do]      statements Loop
  • 6.
    Example of DoWhile Print Table Module Module1 Sub Main() Dim a, i As Integer a = 1 console.writeline("Enter the number") i =Console.ReadLine() Do While a < 10 a = a + 1 Console.WriteLine(a * i) Loop Console.ReadKey() End Sub End Module
  • 7.