C# Program to check Palindrome number

In this article, I will be writing a C# Program to check the Palindrome number. I will be explaining to you the working of the program and also show you the output of the program.

What is Palindrome Number?

When the digits are reversed, a palindromic number stays the same. It has reflectional symmetry along a vertical axis, to put it another way. The term palindromic comes from palindrome, which refers to a word with the same spelling when the letters are reversed. For example, the number 12321 is a palindrome number, but 1451 is not a palindrome number.

Examples of Palindrome Number:

Input: 1221
Output: True

Input: 146541
Output: False

Input: 5
Output: True

C# Program to check Palindrome number

Here’s the C# Program to check Palindrome number:

using System;

namespace CheckPalindrome
    class Program
        static void Main(string[] args)
            int num, n, reverseNo=0,r;
            Console.WriteLine("Enter the number :");
            num = Convert.ToInt32(Console.ReadLine());
            n = num;
                r = n % 10;
                reverseNo = reverseNo*10+r;
                n = n / 10;
            if (num == reverseNo)
                Console.WriteLine("Entered number {0} is palindrome number", num);
                Console.WriteLine("Entered number {0} is not a palindrome number", num);



Here’s the output of the above C# Program:

Related Articles

  1. C# Program to Check Vowels or Consonants
  2. Convert Word to PDF using C# Program
  3. C Program to input 3×3 matrix and print sum of all elements
  4. C Program to Make a Digital Clock Using C Graphics
  5. C Program for Moving Car Animation Using C Graphics

Similar Posts

Leave a Reply

Your email address will not be published.