Wednesday, July 24, 2013

Printing of characters of String in Reverse Order in C Sharp

//File Name: reverse
//Author: SURESH BABU
//Reference: Printing of characters of String in Reverse Order

using System;


namespace reverse
{
    class Program
    {
        static void Main(string[] args)
        {
            string name = "SURESH BABU";
            string reverse = "";
            foreach (char ch in name)
            {
                reverse = ch +reverse;
            }
            Console.WriteLine(reverse);
        }
    }
}

No comments:

Post a Comment