public static void Main()
Console.Write("Enter the number of rows: ");
int N = int.Parse(Console.ReadLine());
Console.Write("Enter the number of columns: ");
int M = int.Parse(Console.ReadLine());
int[,] a = new int[N, M];
for (int r = 0; r < N; r++)
for (int c = 0; c < M; c++)
a[r, c] = x.Next(10,100);
for (int r = 0; r < N; r++)
for (int c = 0; c < M; c++)
Console.Write("{0,4}", a[r, c]);
for (int r = 0; r < N; r++)
for (int c = 0; c < M; c++)
if (a[r, c] < min) min = a[r, c];
if (a[r, c] < max) max = a[r, c];
Console.WriteLine("The smallest value of an array element is: " + min);
Console.WriteLine("The smallest value of an array element is: " + max);
for (int c = 0; c < M; c++) S = S + a[k, c];
Console.WriteLine("The sum of the elements of row {0} is: {1}", k, S);
Console.WriteLine("The avarage of the elements of row {0} is: {1:F2}", k, S/M);