0% found this document useful (0 votes)
8 views3 pages

Prac 6

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Prac 6

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Practical No: 06

Name :Saad Momin Enrolment:2205690315

Code:01
Module Module1

Sub Main()
Dim x As Integer
x=1
While x <= 10
Console.WriteLine("Number {0}", x)
x=x+1

End While
Console.WriteLine("Press any key to exit...")
Console.ReadKey()
End Sub

End Module
Output:

Code:02
Imports System.Linq.Expressions
Module Module1

Sub Main()
Dim i As Integer = 1
Do
Console.WriteLine("value of variable I is :" & i)
i=i+1
Loop While i <= 10
Console.WriteLine("press any key to exit..")
Console.ReadKey()
End Sub
End Module
Output:
Code No: 03
Module Module1

Sub Main()
Dim i, j As Integer
i=2
While (i <= 100)
j=2
While (j < i)
If (i Mod j = 0) Then
Exit While
ElseIf (i = j + 1) Then
Console.WriteLine(i)

End If
j=j+1
End While
i=i+1
End While
Console.ReadLine()
End Sub

End Module

Output:

Code No: 04
Imports System.Net

Module Module1

Sub Main()
Dim i As Integer = 1
While (i <= 50)
If ((i Mod 2) = 0) Then
Console.WriteLine(i & " is Even")
Else
Console.WriteLine(i & " is Odd")
End If
i=i+1

End While
Console.ReadLine()

End Sub

End Module

Output:

You might also like