Reverse Word in C#

public static void Main(string[] args)
{
Console.WriteLine(“Enter the Word:”);
string s = Console.ReadLine();
string[] a = s.Split(‘ ‘);
Array.Reverse(a);
Console.WriteLine(“Reverse Word is:”);
for(int i = 0; i <= a.Length – 1; i++)
{
Console.Write(a[i]+””+’ ‘);
}
Console.ReadKey();
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected with IP Blacklist CloudIP Blacklist Cloud

This site uses Akismet to reduce spam. Learn how your comment data is processed.