C# Saved Program: serene-dog

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.



namespace TheOnlineCompiler
{
    class Program 
    {
        static string reverse(string input) {
            char[] chars = input.ToCharArray();
            for (int i = 0; i < chars.Length / 2; i += 1) {
                int from = i;
                int to = chars.Length - 1 - i;
                char temp = chars[from];
                chars[from] = chars[to];
                chars[to] = temp;
            }
            return new string(chars);
        }
        static void Main() 
        {
            System.Console.WriteLine("Hello World!");
            System.Console.WriteLine(reverse("Hel"));
        }
    }
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs