Explore Westonci.ca, the leading Q&A site where experts provide accurate and helpful answers to all your questions. Get the answers you need quickly and accurately from a dedicated community of experts on our Q&A platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.
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
}}
Thanks for using our service. We aim to provide the most accurate answers for all your queries. Visit us again for more insights. Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. Thank you for using Westonci.ca. Come back for more in-depth answers to all your queries.