10 Program to check whether Even or Odd in VB.NET

Code:

Module Module1

    Dim num, n As Integer

    Sub Main()

        Console.WriteLine("Enter any number: ")

        num = Console.ReadLine()
        n = num Mod 2
        If n = 0 Then
            Console.WriteLine("Even")
        Else
            Console.WriteLine("Odd")
        End If

        Console.ReadKey()
    End Sub

End Module

Previous
Next Post »