Define a function called digits that accepts two integer numbers m and n , and that displays m rows of n columns using the following pattern of digits. The first row starts with 1, the second row with 2, and so on until the 10th row starts with 0. Then the counter returns to 1 for the 11th row, then to 2 for the 12th, etc. For columns, the numbers are always incremented by 1 from the previous column, Except for the 9 that goes to 0. For example, the call digits(4, 7) must produce: 1234567 2345678 3456789 4567890 and the call numbers(12, 23) must produce: 12345678901234567890123 23456789012345678901234 34567890123456789012345 45678901234567890123456 56789012345678901234567 67890123456789012345678 78901234567890123456789 89012345678901234567890 90123456789012345678901 01234567890123456789012 12345678901234567890123 23456789012345678901234 Note that your function should not return anything, only display at the console.
Define a function called digits that accepts two integer numbers m and n , and that displays m rows of n columns using the following pattern of digits. The first row starts with 1, the second row with 2, and so on until the 10th row starts with 0. Then the counter returns to 1 for the 11th row, then to 2 for the 12th, etc. For columns, the numbers are always incremented by 1 from the previous column, Except for the 9 that goes to 0.
For example, the call digits(4, 7) must produce:
1234567
2345678
3456789
4567890
and the call numbers(12, 23) must produce:
12345678901234567890123
23456789012345678901234
34567890123456789012345
45678901234567890123456
56789012345678901234567
67890123456789012345678
78901234567890123456789
89012345678901234567890
90123456789012345678901
01234567890123456789012
12345678901234567890123
23456789012345678901234
Note that your function should not return anything, only display at the console.
- Start.
- Read the two inputs.
- Make the matrix.
- Display it.
- Exit.
Step by step
Solved in 4 steps with 1 images