using System;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
int[][] jagged = new int[3][];
Random rnd = new Random();
for (int i = 0; i < jagged.Length; i++)
jagged[i] = new int[rnd.Next(4, 10)];
// set values
for (int i = 0; i < jagged.Length; i++)
for (int j = 0; j < jagged[i].Length; j++)
jagged[i][j] = rnd.Next(1, 100);
// print
for (int i = 0; i < jagged.Length; i++)
{
Console.Write("jagged[{0}] = ", i);
for (int j = 0; j < jagged[i].Length; j++)
Console.Write("{0, 4}", jagged[i][j]);
Console.WriteLine();
}
}
}
}
/*
run:
jagged[0] = 34 11 28 27 9 55 14 78 98
jagged[1] = 24 26 20 32
jagged[2] = 30 68 98 47 27
*/