Test a given number is even or odd

Posted by Satyapriyanayak under VB.NET category on | Points: 40 | Views : 776
In this Code Snippet we will know how to test a given number is even or odd. 

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As Integer
x = TextBox1.Text
If x Mod 2 = 0 Then
MsgBox("The Number is Even")
MsgBox("The Number is Odd")
End If
End Sub
End Class

Comments or Responses

Login to post response