I am new here please help me out. code is running but afterwards compailer is not printing anything and giving error of IndexOutOfRangeException.
class Program
{
static void Main(string[] args)
{
string brd = board();
string[] sub = subjects();
Console.WriteLine(brd);
Console.WriteLine(sub);
Console.ReadLine();
}
public static string board()
{
Console.WriteLine("Please Enter Board Name ");
string Board = Console.ReadLine();
return Board;
}
public static string[] subjects()
{
Console.WriteLine("Please Enter How many Subject Do you Want to input");
int limit = System.Convert.ToInt32(Console.ReadLine());
string[] Subjects = new string[limit];
string[] index = new string[limit];
for (limit = 1; limit <= index.Length; limit++)
{
Console.WriteLine("Please Enter Subject Name " + limit );
Subjects[limit] = Console.ReadLine();
}
return Subjects;
}
}