Multiple Inheritance can be achieved in C# using Interfaces. This simple mathematical operation program demonstrates how multiple inheritance can be achieved in C# using Interface Concept.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MultipleInheritApplication
{
interface calc1
{
int add(int a, int b);
}
interface calc2
{
int sub(int x, int y);
}
interface calc3
{
int mul(int r, int s);
}
interface calc4
{
int div(int c, int d);
}
class Calculation : calc1, calc2, calc3, calc4
{
public int result1;
public int add(int a, int b)
{
return result1 = a + b;
}
public int result2;
public int sub(int x, int y)
{
return result2 = x - y;
}
public int result3;
public int mul(int r, int s)
{
return result3 = r * s;
}
public int result4;
public int div(int c, int d)
{
return result4 = c / d;
}
class Program
{
static void Main(string[] args)
{
Calculation c = new Calculation();
c.add(8, 2);
c.sub(20, 10);
c.mul(5, 2);
c.div(20, 10);
Console.WriteLine("Multiple Inheritance concept Using Interfaces :\n ");
Console.WriteLine("Addition: " + c.result1);
Console.WriteLine("Substraction: " + c.result2);
Console.WriteLine("Multiplication :" + c.result3);
Console.WriteLine("Division: " + c.result4);
Console.ReadKey();
}
}
}
}
In the above code example, calc1, calc2, calc3, and calc4 are four interfaces. The Calculation class in inherited from four different interfaces and implements them. This is one way you can achieve multiple inheritance using interfaces in C#.
Output
Next recommended readings

Andrew GPosted Jul 9, 2019, 12:06 AM
This is not an example of inheritance. Why would I inherit 3 interfaces when ultimately I have to write code in my class only.
Prasanth KumarPosted Apr 5, 2019, 1:46 AM
What? Where is inheritence here, the concept of inheritance should provide you code re-use, where is code reuse here, you are just implementing everything in your interface. Frankly speaking interfaces are just a contract and they cannot solve multiple inheritance problem in any way.
Kundan PatilPosted Sep 22, 2018, 1:09 PM
We could implement this without interface, even if you remove all interface part and inheritance part, it will run same as now, I don't see any use of interface or inheritance here except it forces to implement those methods from interfaces, what I want is, if I have very big piece of code in class A and another code in class B and I want to use them both in class C then how can I do that, that will be achievement of multiple inheritance.
Vinay PaluparthiPosted Sep 19, 2018, 6:13 AM
What if all the interfaces contain same method with same signature?
Ashish SrivastavaPosted Apr 8, 2016, 5:20 AM
Beautifully explained...
SHRUTI dwivediPosted Mar 11, 2016, 9:31 PM
..
Phaneendra ChakravaramPosted Jan 22, 2016, 8:49 AM
Nice one
Rajeesh MenothPosted Jul 30, 2015, 2:36 AM
Good One
taskin khlqPosted May 13, 2015, 4:42 AM
Good example for beginner. it's all clear so does not need to describe :)
Vitthal RandivePosted Nov 17, 2014, 4:26 AM
Multiple inheritance mean add two class method in one class. mean I have class a with method add and class b with method sub I want both of then inherit in class c with mul method. so I am not clear please mail me on [email protected]