NedyalkoKikov

EvenOrOddInMethod

May 4th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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 EvenOrOdd
  10. {
  11. static void Main()
  12. {
  13. int num = int.Parse(Console.ReadLine());
  14. CheckIFNumberISEven(num);
  15. }
  16. public static int CheckIFNumberISEven(int num)
  17. {
  18. if(num % 2 == 0)
  19. {
  20. Console.WriteLine($"Number {num} is even");
  21. }
  22. else
  23. {
  24. Console.WriteLine($"Number {num} is odd");
  25. }
  26. return num;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment