Tsallaka zuwa abun ciki
Justice Tech School

Arrays

Arrays have a fixed size and zero based index. Use Length, Array.Sort and Array.Reverse.

Example
int[] a = { 5, 3, 9, 1 };
Array.Sort(a);
Console.WriteLine(string.Join(",", a));
Array.Reverse(a);
Console.WriteLine(a[0] + " " + a.Length);
int[,] g = new int[2, 3];
g[1, 2] = 7;
Console.WriteLine(g.GetLength(1));

Exercise

Sort an array.

Array.(a)

Quiz Test

Is array size fixed?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.