- Home
·
- Math/Dates
·
- This code is for checking whether a number is even or odd.
This code is for checking whether a number is even or odd.
This code is for checking whether a number is even or odd.
API Declarations
DIM NUM2 AS Integer 'Second way to do it
DIM NUM3 AS Integer 'Third way to do it
Rate This code is for checking whether a number is even or odd.
(1(1 Vote))
NUM = InputBox ("Input the number to check:")
If NUM Mod 2 = 0 Then
Print "Even"
Else
Print "Odd"
End If
'Second way
NUM2 = InputBox("Input the number:")
If NUM2 / 2 = Math.Round(NUM2 / 2) Then
Print "Even"
Else
Print "Odd"
End If
'Third way
NUM3 = InputBox("Input the Number:")
If NUM3 / 2 = Int(NUM3 / 2) Then
Print "Even"
Else
Print "Odd"
End If
This code is for checking whether a number is even or odd. Comments
No comments yet — be the first to post one!
Post a Comment