Wednesday, 14 October 2015

Reverse a string using reverse function in C#

using System;
class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Enter a word for reverse");
            string str = Console.ReadLine();
            Char[] chararray = str.ToCharArray();
            Array.Reverse(chararray);
            Console.WriteLine("Reverse of entered number is {0}",chararray);
        }
    }

No comments:

Post a Comment