class Program
while (num >= 0)
{
static void Main(string[] args)
{
string str = "", reverse = "";
str = "honesty is the best policy";
int num = str.Length - 1;
{
if (str[num] != ' ')
{
reverse = reverse +
str[num];
}
num--;
}
Console.WriteLine(reverse);
Console.ReadLine();
}
}
No comments:
Post a Comment