May 2021 0 34 Report
How do I convert C++ rows to columns?

I have done part A as it was simple, but I'm drawing a blank as to how I can transpose this. Any thoughts?

a. 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.

1 2 3 4 5 6 7 8

9 10 11 12 13 14 15 16

73 74 75 76 77 78 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…).

1 11 21 31 41 51 61 71

2 12 22 32 42 52 62 72

10 20 30 40 50 60 70 80

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 QUIZLS.COM - All rights reserved.