public void TestImparPar() { Int32 entero = new Int32(); entero = 2; Assert.IsTrue(entero.EsPar()); entero = 3; Assert.IsTrue(entero.EsImpar()); }
static void Main(string[] args) { Int32 var = new Int32(); var = int.Parse(Console.ReadLine()); Console.WriteLine("Es par: " + var.EsPar()); Console.WriteLine("Es impar: " + var.EsImpar()); Console.ReadKey(); }