Advertisement
veronikaaa86

3. Четно или нечетно

Dec 23rd, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Sub Demo()
  2. Dim result As String
  3.  
  4. result = EvenOrOdd(2)
  5.  
  6. Debug.Print result
  7.  
  8. End Sub
  9.  
  10. Function EvenOrOdd(num As Integer)
  11. If num Mod 2 = 0 Then
  12. EvenOrOdd = "even"
  13. 'MsgBox "even"
  14. Else
  15. EvenOrOdd = "odd"
  16. 'MsgBox "odd"
  17. End If
  18. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement