← Back to Loops
Question 203
Five by Five Multiplication Grid
Five by Five Multiplication Grid
Write a program that prints a 5 by 5 multiplication grid. There are 5 rows and 5 columns; the value at row i and column j is i times j. Print each row on its own line with the numbers separated by single spaces (no trailing space at the end of a line). This combines two loops: an outer loop for the rows and an inner loop for the columns. No input is required.
Expected Output:
1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.