Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. namespace ConsoleApp1
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             int ecks;
  8.             Console.WriteLine("Gib Number! ");
  9.             ecks = Console.Read();
  10.             OddChecker.NumChecker(ecks);
  11.         }
  12.     }
  13.     class OddChecker
  14.     {
  15.         public static void NumChecker(int x)
  16.         {
  17.             if (x == 0){ Console.WriteLine("Zero!"); }
  18.             if (x != 0 && x % 2 == 0) { Console.WriteLine("Even!"); }
  19.             if (x != 0 && x % 2 !=0) { Console.WriteLine("Odd!"); }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement