using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Palindrome
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Any number");
int num = int.Parse(Console.ReadLine());
int rev = 0, rem, n;
n = num;
while (num != 0)
{
rem = num % 10;
rev = rev * 10 + rem;
num = num / 10;
}
Console.WriteLine("\n Original number is" + n);
Console.WriteLine("\n Reversed number is" + rev);
if (n == rev)
{
Console.WriteLine("\n Original Number = Reversed Number");
Console.WriteLine("\n So,{0} is Palindrome", n);
Console.ReadLine();
}
else
{
Console.WriteLine("\n Original Number != Reversed Number");
Console.WriteLine("\n So,{0} is not Palindrome", n);
Console.ReadLine();
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Palindrome
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Any number");
int num = int.Parse(Console.ReadLine());
int rev = 0, rem, n;
n = num;
while (num != 0)
{
rem = num % 10;
rev = rev * 10 + rem;
num = num / 10;
}
Console.WriteLine("\n Original number is" + n);
Console.WriteLine("\n Reversed number is" + rev);
if (n == rev)
{
Console.WriteLine("\n Original Number = Reversed Number");
Console.WriteLine("\n So,{0} is Palindrome", n);
Console.ReadLine();
}
else
{
Console.WriteLine("\n Original Number != Reversed Number");
Console.WriteLine("\n So,{0} is not Palindrome", n);
Console.ReadLine();
}
}
}
}