Question - How to find if a number is a palindrome or not in C#.
Answer -
using System;
public class PalindromeNum
{
public static void Main(string[] args)
{
int n,r,num=0,Dem;
Console.Write("Enter the Number: ");
n = int.Parse(Console.ReadLine());
dem=n;
while(n>0)
{
r=n%10;
num=(num*10)+r;
n=n/10;
}
if(dem==num)
Console.Write("Number is Palindrome.");
else
Console.Write("Number is not Palindrome");
}
}