Hi,
I'm trying to write a little program that stores 3 instances of lottery results in a 2d array. My aim is to have each of the separate lottery results printed on a separate line, like this:
Result 1: 1 2 3 4 5 6 7
Result 2: 1 2 3 4 5 6 7
Result 3: 1 2 3 4 5 6 7
I've got the below code:
---------------------------------
int[,] resultsArray = new int[,]
{
{1, 2, 3, 4, 5, 6, 7},
{2, 3, 4, 5, 6, 7, 8},
{3, 4, 5, 6, 7, 8, 9}
};
for (int i = 0; i < 6; i++)
{
Console.Write(r esultsArray[0, i]);
}
---------------------------------
I'm struggling to figure out how to implement loops to achieve the desired output. Can anyone help? As it stands I have the first set printed, but not the other two. As you can probably tell I'm new to c#.
Cheers
Neil
I'm trying to write a little program that stores 3 instances of lottery results in a 2d array. My aim is to have each of the separate lottery results printed on a separate line, like this:
Result 1: 1 2 3 4 5 6 7
Result 2: 1 2 3 4 5 6 7
Result 3: 1 2 3 4 5 6 7
I've got the below code:
---------------------------------
int[,] resultsArray = new int[,]
{
{1, 2, 3, 4, 5, 6, 7},
{2, 3, 4, 5, 6, 7, 8},
{3, 4, 5, 6, 7, 8, 9}
};
for (int i = 0; i < 6; i++)
{
Console.Write(r esultsArray[0, i]);
}
---------------------------------
I'm struggling to figure out how to implement loops to achieve the desired output. Can anyone help? As it stands I have the first set printed, but not the other two. As you can probably tell I'm new to c#.
Cheers
Neil
Comment