In this program you will use a nested loop to generate the following outputs: $ ./a.out 1 22 333 4444 55555 666666 7777777 XXXXXXXXXX $ ./a.out 1 22 333 4444 55555 666666 As you see, the height of the...




In this program you will use a nested loop to generate the following outputs:

$ ./a.out

1

22

333

4444

55555

666666

7777777

88888888











$ ./a.out

1

22

333

4444

55555

666666

As you see, the height of the shape (i.e the number of displayed lines) is equal to the

last number being displayed in the shape (8 in first example, and 6 in second example).

The number of digits being displayed on each line is equal to the digit itself. For

example, there are six 6’s in the last line of the second example.

To get these outputs:

• Generate a seeded random integer between 5 and 9, inclusive. This number

will be the height of the generated shape i.e. the number of lines being

displayed.

• Using a nested loop of your choice, display the shape. Here the outer loop

should control the number of lines and the inner loop should control the digits

being displayed in each line.






Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here