Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace project2.b4
{
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);
}
{
return (x * y);
}
}
class Program
{
static void Main(string[] args)
{
Computation com = new Computation(10, 20);
Addtion add = (Addtion)com;
Multiplication mul = (Multiplication)com;
A.WriteLine("Sum=" + add.Add());
A.WriteLine("product=" + mul.Mul());
A.ReadKey();
}
}
}
Comments
Post a Comment