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
Output
ReplyDeleteOutput is where
ReplyDelete