Using the following declarations, write solutions for Steps a through e. int [ , ] cArray =
Question:
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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
C# Programming From Problem Analysis To Program Design
ISBN: 9781285856872
5th Edition
Authors: Barbara Doyle
Question Posted: