Assume the declaration of the array below.
a) can you use a single foreach loop to write a segment of code that will get the sum of all the 12 integers in the multidimensional array? 17 se, de
static void Main(string[] args)
{
int[] amultidimarray = {(1, 2, 3), (3, 4, 5), (6, 7, 8), (9, 8, 7)};
int sum;
// your code would go here
}
b) Write a segment of code that would triple the value of each element of the multidimensional array amultidimarray.
c) Will your code in a) and b) work if the array was declared as:
int[][] amultidimarray = {(1, 2, 3), (3, 4, 5), (6, 7, 8), (9, 8, 7)};
Explain why or why not?