using System;
class Program
{
static void Main(string[] args)
{
string str = string.Empty;
Console.WriteLine("Enter a String");
string s = Console.ReadLine();
int i = s.Length;
for (int j = i - 1; j >= 0; j--)
{
str = str + s.ToUpper()[j];
}
if (str == s.ToUpper())
{
Console.WriteLine(s + " is palindrome string ");
}
else
{
Console.WriteLine(s + " is not a palindeome string");
}
Console.WriteLine(str);
Console.ReadLine();
}
}
Output
class Program
{
static void Main(string[] args)
{
string str = string.Empty;
Console.WriteLine("Enter a String");
string s = Console.ReadLine();
int i = s.Length;
for (int j = i - 1; j >= 0; j--)
{
str = str + s.ToUpper()[j];
}
if (str == s.ToUpper())
{
Console.WriteLine(s + " is palindrome string ");
}
else
{
Console.WriteLine(s + " is not a palindeome string");
}
Console.WriteLine(str);
Console.ReadLine();
}
}
Output
No comments :
Post a Comment