C#随机产生一些数,然后判断哪些是奇数,哪些是偶数

C#随机产生一些数,然后判断哪些是奇数,哪些是偶数,
并输出。

问题解决的话,请点我回答左上角的采纳和向上箭头

using System;
using System.Linq;

public class Test
{
    public static void Main()
    {
        // your code goes here
        int[] arr = new int[10];
        Random rnd = new Random();
        for (int i = 0; i < 10; i++)
            arr[i] = rnd.Next(0, 10);
        Console.WriteLine("奇数" + string.Join(",", arr.Where(x => x % 2 == 1)));
        Console.WriteLine("偶数" + string.Join(",", arr.Where(x => x % 2 == 0)));
    }
}