implement the program for finding greatest of three numbers in vb.net

Find the greatest among 3 integers






Module Greatest
    Sub main()
        Dim a, b, c As Integer
        Console.Write("Enter the values of a,b and c :")
        a = CInt(Console.ReadLine())
        b = CInt(Console.ReadLine())
        c = CInt(Console.ReadLine())
        If a > b Then
            If a > c Then
                Console.WriteLine("Greatest=" + a.ToString())
            Else
                Console.WriteLine("Greatest=" + c.ToString())
            End If
        Else
            If b > c Then
                Console.WriteLine("Greatest=" + b.ToString())
            Else
                Console.WriteLine("Greatest=" + c.ToString())
            End If

        End If

        Console.ReadLine()
    End Sub
End Module

Comments

Post a Comment

If you have any query, please let us know