Practical No 04 Gad 22034 1
Practical No 04 Gad 22034 1
Practical No 04 Gad 22034 1
Practical No: 04
End If
Else
If (b > c) Then
2. Implement the program using if-else statement to find the number is even or odd –
Module Module1
Dim i As Integer
Sub Main()
Console.WriteLine("Enter Number")
i = Console.ReadLine()
If ((i Mod 2) = 0) Then
Console.WriteLine("Number is Even")
Else
Console.WriteLine("Number is Odd")
End If
Console.ReadLine()
End Sub
End Module
XIV. Exercise
1. Write the program using if-else statement for following output.
Result Percentage Criteria
Fail perc < 40
Second Class perc > 40 AND perc < 60
First Class perc > 60 AND perc < 75
Distinction perc > 75
Module Module1
Sub Main()
Dim perc As Integer
Console.Write("Enter Percentage:")
perc = Val(Console.ReadLine())
GUI Application Development using VB.Net (22034) Page 2
Practical No. 4: Implement a program for If-else control structures in VB.NET.
End Module
Sub Main()
Dim i As Integer
i=4
Dim a As Double
a = -1.0
If (i > 0) Then
If (a > 0) Then
Console.WriteLine("Here I am !!!!")
Else
Console.WriteLine("No here I am ??")
Console.WriteLine("Actually here I am ??")
End If
End If
Console.ReadKey()
End Sub
End Module