VB.Net Program to Check the Given Number Is Even or Odd

You are currently viewing VB.Net Program to Check the Given Number Is Even or Odd

VB.Net program to check the given number is even or odd

'VB.Net program to check the given number is even or odd.

Module Module1
    
    Sub Main()
        Dim num As Integer = 0
        
        Console.Write("Enter number: ")
        num = Integer.Parse(Console.ReadLine())

        If num Mod 2 = 0 Then
            Console.WriteLine("Given number is EVEN")
        Else
            Console.WriteLine("Given number is ODD")
        End If
    End Sub
    
End Module

Output

Enter number: 122
Given number is EVEN
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply