Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 2. Nested Loops Write a program, using nested loops, which outputs the numbers from 1 to 80 in 8 columns and 10 rows. Your

image text in transcribed

image text in transcribed

Part 2. Nested Loops Write a program, using nested loops, which outputs the numbers from 1 to 80 in 8 columns and 10 rows. Your output should look something like this. (The sample programs should help you figure out how to do this) a. 1 2 3 4 5 6 78 16 9 10 11 12 73 74 75 76 7778 79 80 b. Now modify it so it outputs the table like this. Note that the numbers go down the columns now (but you still have to output row by row...). You may need to do some thinking to figure out how to do this; it might help to do it on paper first, and figure out what you need to add as you go across the columns, and as you go down to the next row. (Hint: for each row, what is the value at the beginning of the row, and what do you need to add to each column to get the value for the next column of the current row?) 1 11 21 31 41 51 61 71 2 12 22 32 42 52 62 72 10 20 30 40 50 60 70 80 Now modify it so it prompts you for the maximum number to output, and the number of rows. (Keep it simple...no need for error checking on the input) c. How many numbers to output? 80 how many rows? 14 1 15 29 43 57 71 2 16 30 44 58 72 3 1731 45 59 73 4 18 32 46 60 74 5 19 33 47 61 75 6 20 34 48 62 76 7 21 35 49 63 77

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions