Why the following code shows error like...
Error 1 'ConsoleApplication1.A' does not contain a constructor that takes '0' arguments.
Please help me.... the code is.....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public class A
{
int a, b;
public A(int p, int q)
{
a = p;
b = q;
Console.WriteLine( a + b);
}
public int add()
{
return a + b;
}
}
public class B:A
{
int c, d;
public B()
{
c = 2;
d = 1;
}
public B(int x, int y)
{
c = x;
d = y;
}
public int sub()
{
return c - d;
}
}
class Program
{
static void Main(string[] args)
{
B b = new B(15,10);
Console.WriteLine(b.add());
Console.WriteLine(b.sub());
Console.Read();
}
}
}
Sra1