You need to give the second dimension for array. In the inner loop you are decrement the loop
variable instead of increment that also results in out of bound exception. You probably need to know the difference between jagged and two dimensional array. The post would explain that.
This statement int bound1 = a.GetUpperBound(1); gives the exception as the second dimension is not yet declared.
Using jagged array.
string[][] a = new string[100][];
int bound0 = a.GetUpperBound(0);
for(int i = 0; i <= bound0; i++)
a[i] = new string[3];
for (int i = 0; i <= bound0; i++)
{
int bound1 = a[i].GetUpperBound(0);
for (int x = 0; x <= bound1; x++)
{
a[i][x] = (i + x).ToString();
string s1 = a[i][x];
Console.WriteLine(s1);
}
}
Using two dimensional array.
string[,] a = new string[100,4];
int bound0 = a.GetUpperBound(0);
int bound1 = a.GetUpperBound(1);
for (int i = 0; i < bound0; i++)
{
for (int x = 0; x < bound1; x++)
{
a[i,x] = (i+x).ToString();
string s1 = a[i,x];
Console.WriteLine(s1);
}
}
Console.WriteLine();
Console.ReadKey();
Edit, based on updates
string[][] a = new string[100][];
int bound0 = a.GetUpperBound(0);
for(int i = 0; i <= bound0; i++)
a[i] = new string[100];
for (int i = 0; i <= bound0; i++)
{
int bound1 = a[i].GetUpperBound(0);
for (int x = bound1; x >= 0; x--)
{
a[i][x] = (i+1).ToString() +"--"+ (x+1).ToString();
string s1 = a[i][x];
Console.WriteLine(s1);
}
}