Answered step by step
Verified Expert Solution
Question
1 Approved Answer
EGR 126 Exercise 7B - Nested for loops The objective of this Exercise is to gain experience with nested for loops by printing the indices
EGR 126 Exercise 7B - Nested for loops The objective of this Exercise is to gain experience with nested for loops by printing the indices of a two dimensional array or matx Write a computer program to print out the indices of a two dimensional array of 5 rows and 3 columns. Use two for loops, one nested within the other: One loop will count from 1 to 5 for the row values. One loop will count from 1 to 3 for the column values. Print out the loop counter values inside the innermost loop, separated by a comma. You will need to determine which loop counts for rows and which counts for columns. You are not actually using an array, just printing the loop counters in an array format as if they are the indices of the entries (row, column) in the two dimensional array You do not need any input for this program. Only use for loops, do not use while, or do-while Your output should look something like the following: CWindows system32jcmd.exe arriette Roadman Exercise B. Nesting For Loops January 24, 2016 Counting with nested loopsindices of row. column 2. 3 3. 3 2. 2 3. 2 4. 2 5. 2 3. 1 5. 3 ress any key to continue.. . Make sure you are understanding how the two loops work together. For additional practice and understanding, after you have submitted the Exercise, try altering the code Change the loop nesting order, Change the index values (try 1 to 7 or 5 to 3), Add a third inner loop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started