Hi there I have a `for` loop process and i want it to convert to `foreach` loop, but I cant get it working, can someone please help me?

```
int pallet = 1;
int[] res = {5,1};

foreach (int element in res)
{
  var resu = res.Length;
  if (resu < pallet)
    { }
  else { }
}

for (int i = 1; i <= res.Length; i++)
{
  if (i <= pallet)
    { }
  else { }
}

```