using System;
namespace MyCompiler {
class Program {
public static void Main(string[] args)
{
Console.WriteLine("Hello world!");
method(3,6);
method(4, 1);
method(5, 3);
}
public static void method(int row, int col)
{
int[,] arr = new int[row,col];
for(int i = 0; i< row;i++)
{
for(int j=0; j< col;j++)
{
arr[i,j] = (i+1) + row *(j);
Console.WriteLine(arr[i,j]);
}
}
}
}
}
/*
Examples
PrintGrid(3, 6) ➞ new int[,] {
new int[] { 1, 4, 7, 10, 13, 16 },
new int[] { 2, 5, 8, 11, 14, 17 },
new int[] { 3, 6, 9, 12, 15, 18 }
]
PrintGrid(5, 3) ➞ new int[,] {
new int[] { 1, 6, 11 },
new int[] { 2, 7, 12 },
new int[] { 3, 8, 13 },
new int[] { 4, 9, 14 },
new int[] { 5, 10, 15 }
]
PrintGrid(4, 1) ➞ new int[,] {
new int[] { 1 },
new int[] { 2 },
new int[] { 3 },
new int[] { 4 }
]
*/
To embed this project on your website, copy the following code and paste it into your website's HTML: