If you can't convert that, then you need to study both languages in a lot more detail...
int[] nums = {1, 3, 6, 9, 8, 2, 9, 3};
int n = nums.Length;
for (int i = 0; i < n; i++)
{
...
But if you are using i to index the values in nums here, then this is better:
int[] nums = {1, 3, 6, 9, 8, 2, 9, 3};
foreach (int num in numbs)
{
...