Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

GUI Application Development using VB.

Net

Name: Rohit Ashok Parsode Roll no: 49


Class: CO4I Sub: GAD
Practical 6: Implement a program for while, DO loops in VB.NET.

While loop:
Code:
Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)


Handles Button1.Click
Dim a As Integer
a = 1
While (a < 10)
a = a + 1
MsgBox("" & a)
End While
End Sub
End Class

Output:
Do loop:
Code:
Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)


Handles Button1.Click
Dim a As Integer
a = 1
Do
a = a + 1
MsgBox("" & a)
Loop While (a < 10)
End Sub
End Class

Output:

You might also like