using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PrimeNumber
{
public class StringReverse
{
static void Main(string[] args)
{
string s, Reversestring = "";
int len;
Console.Write("Enter a String : ");
s = Console.ReadLine();
// s = "Hello World";
len = s.Length - 1;
while (len >= 0)
{
Reversestring = Reversestring + s[len];
len--;
}
Console.WriteLine("Reverse String is {0}", Reversestring);
Console.WriteLine(" Original String is :" + s);
Console.ReadLine();
}
}
}
No comments:
Post a Comment