Using the following declarations, write solutions for Steps a through e.
int [ , ] cArray = new int [2, 3];
string [ , , ] dArray = new string [5, 2, 6];
a. Write a foreach loop to display the contents of cArray.
b. Write a for loop to increment each element in cArray by 5.
c. Write a foreach loop to display the contents of dArray.
d. Can you use a foreach loop to initialize all elements of dArray with
zero? If so, show your code. If not, explain why.
e. Write a for loop to initialize all elements in dArray to zero.
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.