/**
This completely depends on what you want to do. In an array you have a collection of things.
If you were shown this array [1,2,3,4] say, in elementary school and someone asked you how many things are in there you would say four.
You would count starting from one, which is completely reasonable.
If someone asked you what the third thing in that array was, you'd point to the 3.
Awesome! Except, now that you're coding, you know that arrays start at zero.
So even though there are still four things in that array, their names have changed.
Now 1's name is zero, 2's name is one, 3's name is two, and 4's name is three.
So when you're using a loop and you just want the loop to go through all the things and that's it (like if you're searching through an array), you can use .length and it'll just run through.
If you want to access the number 4 in the array specifically, though, 4's name is no longer 4 - it's 3! So you use length-1 because when it comes to indexes, we're using the new name given to the physical thing.
**/
using System;
public class Program
{
public static void Main()
int[] oldArray = {1,2,3,4,5};
int lastElement = oldArray.Length - 1; // 4
int ele = oldArray.Length; //5
int res = oldArray[lastElement] ;// returns last element, 5
Console.WriteLine(res);
Console.WriteLine(ele);
}