Professional Documents
Culture Documents
PRACTICAL : 1
1) If Then Statement
CODE :
Module VBModule
Sub Main()
Dim a As Integer = 10
Dim b As Integer = 10
if(a = b)Then
Console.WriteLine("A is Equals to B")
End if
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
CODE :
Module VBModule
Sub Main()
Dim a As Integer = 10
Dim b As Integer = 20
if(a = b)Then
Console.WriteLine("A is Equals to B")
Else
Console.WriteLine("A is Not Equals to B")
End if
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
CODE :
Module VBModule
Sub Main()
Dim a As Integer = 10
Dim b As Integer = 20
Dim c As Integer = 10
if(a = b)Then
Console.WriteLine("A is Equals to B")
Elseif(a = c)Then
Console.WriteLine("A is Equals to C")
End if
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
CODE :
Module VBModule
Sub Main()
Dim A As Integer
A = Console.ReadLine()
Select Case A
Case 1
Console.WriteLine("Case 1 is Executed")
Case 2
Console.WriteLine("Case 2 is Executed")
End Select
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
PRACTICAL : 2
CODE :
Module VBModule
Sub Main()
Dim A As Integer
Dim B As Integer
Console.WriteLine("202002100410008")
Console.WriteLine("Enter First Number :")
A = Console.ReadLine()
Console.WriteLine("Enter Second Number : ")
B = Console.ReadLine()
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
PRACTICAL : 3
CODE :
Module VBModule
Sub Main()
Console.WriteLine("202002100410008")
Console.WriteLine("Select operation you want to perform")
Console.WriteLine("1: Addition")
Console.WriteLine("2: Subtraction")
Console.WriteLine("3: Multiplication")
Console.WriteLine("4: Division")
Sum = A + B
Console.WriteLine("Addition of A and B is : " & Sum)
Case 2
Subb = A - B
Console.WriteLine("Substraction of A and B is : " & Subb)
Case 3
Multi = A * B
Console.WriteLine("Multiplication of A and B is : " & Multi)
Case 4
dx = A / B
Console.WriteLine("Division of A and B is : " & dx)
Case Else
Console.WriteLine("Invalid choice")
End Select
'End if
Console.ReadLine()
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
PRACTICAL : 4
CODE :
Module VBModule
Sub Main()
Dim A As String
Console.WriteLine("202002100410008")
Console.WriteLine("Enter Your Grade")
A = Console.ReadLine()
End if
Console.ReadKey()
End Sub
End Module
OUTPUT :
EN NO : 202002100410008
EN NO : 202002100410008
PRACTICAL : 5
CODE :
End Sub
End class
EN NO : 202002100410008
OUTPUT :
EN NO : 202002100410008
PRACTICAL : 6
CODE :
OUTPUT :
EN NO : 202002100410008
EN NO : 202002100410008
PRACTICAL : 7
CODE :
B = TextBox1.Text
TextBox1.Text = ""
Select Case OP
Case "+"
TextBox1.Text = A + B
Case "-"
TextBox1.Text = A - B
Case "x"
TextBox1.Text = A * B
Case "÷"
TextBox1.Text = A / B
End Select
End Sub
EN NO : 202002100410008
OUTPUT :
EN NO : 202002100410008
PRACTICAL : 8
CODE :
var2 = 61.82
ElseIf (ComboBox2.SelectedItem = "AED") Then
var2 = 21.74
End If
res = TextBox1.Text
Dim var As Double
TextBox3.Text = var
End Sub
End Class
OUTPUT :
EN NO : 202002100410008
EN NO : 202002100410008
EN NO : 202002100410008
PRACTICAL : 9
CODE :
End Sub
End Sub
End Sub
End Class
OUTPUT :
EN NO : 202002100410008
EN NO : 202002100410008
PRACTICAL : 10
Aim : Paint Application in Vb.Net Using Visual Studio.
CODE :
End Sub
mybrush = Brushes.Black
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
mybrush = Brushes.Red
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles
Button4.Click
mybrush = Brushes.Gray
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
mybrush = Brushes.Blue
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles
Button5.Click
mybrush = Brushes.Green
End Sub
End Class
OUTPUT :
EN NO : 202002100410008