string reverse

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

namespace stringreverse
{
class Program
{
static void Main(string[] args)
{
string first;
int j=0;

Console.WriteLine("Enter the first string");
first = Console.ReadLine();

char[] firstArr = first.ToCharArray();
char[] secondArr = first.ToCharArray();

for (int i = first.Length - 1; i >= 0; i--)
{
secondArr[j] = firstArr[i];
j++;
}

Console.WriteLine(secondArr);
Console.ReadLine();
}
}
}

Comments

Popular posts from this blog

Network Security: LAN manager authentication level

Cisco AnyConnect Secure Mobility Client - VPN service not available. The VPN agent service is not responding