Thursday, 30 August 2012

VB Program - To find out whether the number is Even number or Odd number?


VB Program - To find out whether the  number is Even number or Odd number?

Program: 

Sub EvenOdd()

Dim varNum
varNum = InputBox("Enter a number")
If varNum Mod 2 = 0 Then
MsgBox varNum + "  is a even number"
Else
MsgBox varNum + "  is a odd number"

End If

No comments:

Post a Comment