In C#, Array.Reverse flips the order of elements so the first becomes last and the last becomes first. It works in place on the same array.
You can reverse the whole array or only a range. A common pattern for descending numbers is Sort then Reverse.
This is a static member of System.Array. You call it with the class name, such as Array.Reverse(...). Arrays in C# have a fixed length after creation; use List<T> when the count must grow.
Syntax
Pass the array (and optionally index + length) to the static method.
C#
Array.Reverse(nums);
Array.Reverse(nums, 1, 3);
Call
What it does
Array.Reverse(nums)
Reverses the entire array.
Array.Reverse(nums, 0, 3)
Reverses the first three elements.
Reverse does not sort. It only flips the current order.
Library declarations
C#
public static void Reverse(Array array);
public static void Reverse(Array array, int index, int length);
Parameters
Parameter
Description
array
Required. Array to reverse in place.
index / length
Optional. Reverse only a slice.
Return Value
Return Value
Description
void
The array order is updated in place.
C# Examples
Example 1 — Flip an Entire Array
Reverse four ints and print the result.
C#
using System;
class Program {
static void Main() {
int[] nums = { 1, 2, 3, 4 };
Array.Reverse(nums);
Console.WriteLine(string.Join(", ", nums));
}
}
Output
4, 3, 2, 1
How It Works
Ends swap. 1 and 4 trade places, then 2 and 3.
In place. No new array is returned.
Length same. Still four elements.
Not sorting. Order is mirrored, not ordered by value.
Example 2 — Descending via Sort + Reverse
Sort ascending, then reverse for largest-first.
C#
using System;
class Program {
static void Main() {
int[] nums = { 40, 10, 30, 20 };
Array.Sort(nums);
Array.Reverse(nums);
Console.WriteLine(string.Join(", ", nums));
}
}
Output
40, 30, 20, 10
How It Works
Sort first. Become 10, 20, 30, 40.
Then reverse. Become 40, 30, 20, 10.
Simple descending. No custom comparer required.
Two steps. Remember both calls when you need high-to-low.
Example 3 — Reverse a Middle Slice
Keep the ends; flip the middle three values.
C#
using System;
class Program {
static void Main() {
int[] nums = { 1, 2, 3, 4, 5 };
Array.Reverse(nums, 1, 3);
Console.WriteLine(string.Join(", ", nums));
}
}
Output
1, 4, 3, 2, 5
How It Works
Index 1, length 3. Touches 2, 3, 4.
Becomes 4, 3, 2. That slice alone is reversed.
Ends fixed. 1 and 5 stay put.
Surgical edit. Useful for local reorder tricks.
Frequently Asked Questions
No. It only flips the current order.
No. It updates the existing array in place.
Array.Sort then Array.Reverse is a simple approach.
Yes. Pass index and length.
Yes. It reverses the sequence of string elements, not characters inside each string.