class Program { interface math { void odd(); void even(); } class test : math { void math.odd() { Console.WriteLine("number is odd"); } void math.even() { Console.WriteLine("number is odd"); } public void sort(math ob) { Console.WriteLine("enter number"); int n = Convert.ToInt32(Console.ReadLine()); if( n%2==0) Console.WriteLine("number is even"); else Console.WriteLine("number is odd"); } } static void Main(string[] args) { math ob = new test(); test ob1=new test(); ob1.sort(ob); Console.ReadKey(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)