Print Greatest Number out of 3 numbers


Module Module1

Sub Main()
Dim num1, num2, num3 As Integer

Console.WriteLine("Enter the first number")
num1 = Console.ReadLine

Console.WriteLine("Enter the second number")
num2 = Console.ReadLine

Console.WriteLine("Enter the third number")
num3 = Console.ReadLine

If num1 > num2 And num1 > num3 Then
Console.WriteLine(num1 & " is the greatest number")
ElseIf num2 > num1 And num2 > num3 Then
Console.WriteLine(num2 & " is the greatest number")
ElseIf num1 = num2 And num2 = num3 Then
Console.WriteLine("Oops ! you have enetered a number thrice. So ! no greater number found")
Else
Console.WriteLine(num3 & " is the greatest number")
End If

Console.ReadKey()

End Sub

End Module

Comments

Popular posts from this blog

Program to extract vowel from the input string

Check whether the input number is arm-strong or not

Print the factorial value of an input number