how to find Reverse String enter by user using C# program

how to find Reverse String enter by user using C# program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace str
{
    class Program
    {
        static void Main(string[] args)
        {
            string str, revstr = "";
            Console.Write("enter Str..");
            str=Console.ReadLine();

            for (int i = str.Length - 1; i >= 0; i--)
            {
                revstr = revstr + str[i];
            }
            Console.WriteLine("reverse str...{0}", revstr);
            Console.ReadLine();
 }
    }

Input : Enter String As following  ABCDEFGH

OutPut : HGFEDCBA


Previous
Next Post »