Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Palindrome Number Program in C#

This is a simple C# program to check whether entered number is Palindrome number or not. If you are a c# beginner or want to start learning the c# programming language, then this program will help you to understand the basics of c# programming. In this program, I will explain how to write a c# program to check Palindrome number.

Palindrome Number Program in c#

Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ). At the end of this program, I have shared the output of program this program.

using System;  

  public class PalindromeNumberProgram
   {  
     public static void Main(string[] args)  
      {  
          int n,r,sum=0,temp;

          Console.Write("Enter any number to check palindrome number: ");  

          n = int.Parse(Console.ReadLine());  

          temp=n;    

          while(n>0)      
          {      
           r=n%10;      
           sum=(sum*10)+r;      
           n=n/10;      
          }      
         
          if(temp==sum) {     
             Console.Write("This number is Palindrome.");      
          } else {
               Console.Write("This number is not Palindrome");     
         }
    }  
  } 

Enter any number to check palindrome number: 153
This number is Palindrome.

The post Palindrome Number Program in C# appeared first on FreeWebMentor.



This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here

Share the post

Palindrome Number Program in C#

×

Subscribe to Programming Blog Focused On Web Technologies

Get updates delivered right to your inbox!

Thank you for your subscription

×