Program for Reverse String without in-build function in C# asp.net

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

namespace reversestring
{
    class Program
    {
        static void Main(string[] args)
        {
            string Str, Revstr = "";
            int Length;

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

            Length = Str.Length - 1;
           
            while (Length >= 0)
            {

                Revstr = Revstr + Str[Length];
                Length--;

            }

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

            Console.ReadLine();

        }
    }
}



Program for Reverse String without in-build function in C# asp.net Program for Reverse String without in-build function in C# asp.net Reviewed by NEERAJ SRIVASTAVA on 10:16:00 AM Rating: 5

No comments:

Powered by Blogger.