C# program to reverse as string using for loop


               The below program reverses a string using for loop in C#.NET and prints the output to Console Window.

Reversing a string using C# 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();
        }
    }
}

OUTPUT
------------
Enter A String : PROGRAMCALL.COM
Reverse  String  Is  MOC.LLACMARGORP



c# string reverse programming in .net C#.NET reverse a string c# program to reverse a string example of for loops in dotnet example of c# program c# for loop