Even Odd in Visual Basic

Published on 07 May 2026 (Updated: 07 May 2026)

Welcome to the Even Odd in Visual Basic page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

Module EvenOdd

    Public Sub Main(args As String())

        If args.Length = 0 Then
            Console.WriteLine("Usage: please input a number")
            Environment.Exit(1)
        End If

        Dim n As Integer

        If Not Integer.TryParse(args(0), n) Then
            Console.WriteLine("Usage: please input a number")
            Environment.Exit(1)
        End If

        Dim result As String = If(n Mod 2 = 0, "Even", "Odd")

        Console.WriteLine(result)

    End Sub

End Module

Even Odd in Visual Basic was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.