You are on page 1of 1

4.1 Implement the program for finding greatest of three numbers.

Module Module1

Sub Main()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Console.WriteLine("Enter the value of a b and c :")
a = Val(Console.ReadLine())
b = Val(Console.ReadLine())
c = Val(Console.ReadLine())

If (a > b) Then
If (a > c) Then
Console.WriteLine("Gretest number is:" & a)
Else
Console.WriteLine("Gretest number is:" & c)

End If
Else
If (b > c) Then
Console.WriteLine("Gretest number is:" & b)
Else
Console.WriteLine("Gretest number is:" & c)
End If
End If
Console.ReadLine()

End Sub

End Module

Output-

You might also like