Q:

How to compare elements in an array in C#?

I will give you an example of what I want to do. If we have as input:
  1 4 3 2 
I want to print all the numbers which are bigger than all the elements to their right. Here we have to print 4, 3 and 2. I've converted the input to an array, but I don't know how to compare the elements. 
 int[] numbers = Console.ReadLine()
            .Split()
            .Select(int.Parse)
            .ToArray();

A:

You can check if the current element is maximum of right slice of array :
int[] numbers = new int[]{ 1, 4 ,3 ,2 };
var result=numbers.Where((number, i) => number == numbers.Skip(i).Max()).ToList();

Output:
4,3,2

