Find answers to your questions and expand your knowledge with IDNLearn.com. Ask your questions and get detailed, reliable answers from our community of experienced experts.
Sagot :
Answer:
(d) for (int n=0; n < HEIGHT; n++) { for (int m=0; m < WIDTH; m++) { anArray[n][m] = 0; }}
Explanation:
Given
HEIGHT [tex]\to[/tex] rows
WIDTH [tex]\to[/tex] columns
Required
Fill the array with zeros
Assume the array has already been declared
First, we iterate through the rows; using:
for (int [tex]n=0[/tex]; [tex]n < HEIGHT[/tex]; [tex]n++[/tex]) {
Next, we iterate through the columns
for (int [tex]m=0[/tex]; [tex]m < WIDTH[/tex]; [tex]m++[/tex]) {
Then we fill the array with the iterating variables of rows and the columns
anArray[n][m]
Lastly, close the loops
}}
Thank you for participating in our discussion. We value every contribution. Keep sharing knowledge and helping others find the answers they need. Let's create a dynamic and informative learning environment together. Your questions deserve precise answers. Thank you for visiting IDNLearn.com, and see you again soon for more helpful information.