5 February 2013

Reverse as string using for loop

using System;

namespace ProgramCall
{
    class StringReverse
    {
        static void Main()
        {

            string Str, Revstr = ""
            Console.Write("Enter A String : ");
            Str = Console.ReadLine();

            for (int i = Str.Length - 1; i >= 0; i--)
            {

                Revstr = Revstr + Str[i];
            }

            Console.WriteLine("Reverse  String  Is  {0}", Revstr);
            Console.ReadLine();
        }
    }
}