latest Post

Reverse an array program in C# .net

using System;
class Program
{
    static void Main()
    {
        int[] array = { 1, 2, 3,4,5,6,7,8,9,10 };

        foreach (int a in array)
        {

            Console.WriteLine(a);
        }

        Array.Reverse(array);

        Console.WriteLine("Reversed Array : ");

        foreach (int value in array)
        {
            Console.WriteLine(value);
        }
        Console.ReadLine();
    }
}

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment