Greatest of two numbers


Module Module1

Sub Main()

'This program checks the greatest number ans shows equal if input numbers are equal.

Dim num1, num2 As Integer 'declaring the numbers

Console.WriteLine("Enter the first number") 'asking to enter the first number
num1 = Console.ReadLine

Console.WriteLine("Enter second second number") ' asking to enter the second number
num2 = Console.ReadLine

'if conditional

If num1 > num2 Then
Console.WriteLine(num1 & " is the greatest number.")
ElseIf num1 = num2 Then
Console.WriteLine("Oops ! you have entered the same number twice")
Else
Console.WriteLine(num2 & " is the greatest number")
End If

Console.ReadLine()
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