using System;
public class Program
{
public static void Main()
Inhertence2 ObjInh = new Inhertence2();
Console.WriteLine("Addition : "+ObjInh.Inhmethod1());
Console.WriteLine("Sub : "+ObjInh.Inhmethod2());
}
public class Inhertence1
public int a = 12;
public int b = 2;
public int ad;
public int Inhmethod1()
ad = a+b;
return(ad);
public class Inhertence2 : Inhertence1
public int Inhmethod2()
return(ad+a-b);