Hi all,
This is the code below which gives me the error mentioned in subject:
Here i want to extract the unique elements: output should be {1,3,5,9}
public static void Main()
{
int[] number={1,1,3,3,3,5,5,5,9,9,9,9};
int n = number.Length;
for (int i = 0; i < n; i++)
{
if (number[i] != number[i + 1])
{
Console.WriteLine(number[i]);
}
}
}
Thanks in advance