using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace reverse_string
{
class Program
{
static void Main(string[] args)
{
string str, revstr = "";
int length;
Console.WriteLine("enter string");
str = Console.ReadLine();
length= str.Length-1;
while(length>=0)
{
revstr = revstr + str[length];
length--;
}
Console.WriteLine("rev string is {0}", revstr);
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace reverse_string
{
class Program
{
static void Main(string[] args)
{
string str, revstr = "";
int length;
Console.WriteLine("enter string");
str = Console.ReadLine();
length= str.Length-1;
while(length>=0)
{
revstr = revstr + str[length];
length--;
}
Console.WriteLine("rev string is {0}", revstr);
Console.ReadKey();
}
}
}
No comments:
Post a Comment