NedyalkoKikov

EvenOrOddV2

May 4th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace EvenOrOdd
  8. {
  9. class EvenOrOddV2
  10. {
  11. static void Main()
  12. {
  13. int num = int.Parse(Console.ReadLine());
  14. if(CheckNumberIsEven(num))
  15. {
  16. Console.WriteLine("number is even");
  17. }
  18. else
  19. {
  20. Console.WriteLine("number is odd");
  21. }
  22.  
  23. }
  24. public static bool CheckNumberIsEven(int num)
  25. {
  26. if(num%2==0)
  27. {
  28. return true;
  29. }
  30. else
  31. {
  32. return false;
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment