Source Code:-
using A = System.Console;
interface Addtion
{
int Add();
}
interface Multiplication
{
int Mul();
}
class Computation : Addtion, Multiplication
{
int x, y;
public Computation(int x, int y)
{
this.x = x;
this.y = y;
}
public int Add()
{
return (x + y);
}
public int Mul()
{
return (x * y);
}
}
class InterfaceTest
{
static void Main(string[] args)
{
Computation com = new Computation(10, 20);
A.WriteLine("Sum=" + com.Add());
A.WriteLine("product=" + com.Mul());
A.ReadKey();
}
}
0 Comments