Created
April 24, 2013 20:40
-
-
Save jnericks/5455397 to your computer and use it in GitHub Desktop.
Revisions
-
jnericks created this gist
Apr 24, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int x = 4; int y = 6; printGrid(x, y); Console.Read(); } static void printGrid(int x, int y) { for (int a = 1; a <= x; a++) { var val = a; // this is what you are missing Console.Write(val + " "); for (int b = 1; b < y; b++) { val = val + x; Console.Write(val + " "); } Console.WriteLine(); } } } }