CSC 171 - Introduction to Computer Programming

Assignment #17 - p. 190/Exercise #5

Due Monday, March 20, 2017

Write a method called printGrid that acceots two integers representing a number of rows and columns and prints a grid of integers from 1 to (row*colemns) in COLUMN major order. For example, the call printGrid(4, 6) should prodice the output:

1 5 9 13 17 21
2 6 10 14 18 22
3 7 11 15 19 23
4 8 12 16 20 24

Write a main prorgam to run the method printGrid .

[Back to the Assignments List]