Write a foreach loop to display the contents of carray


Problem

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.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a foreach loop to display the contents of carray
Reference No:- TGS02645490

Expected delivery within 24 Hours