Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

C++ Programming

C++ Program to Check Whether the Entered Number is Palindrome or Not

palindrome number

Write a Program to Check Whether the Entered Number is Palindrome or Not

Source Code

#include<iostream>

#include<conio.h>

using namespace std;

int main()

{

int n,r,s=0,t;

cout<<"enter a number:";

cin>>n;

r=n;

while(r!=0)

{

    t=r%10;

    s=(s*10+t);

    r=r/10;

}

if(s==n)

    cout<<endl<<n<<"Number is palindrome";

else

    cout<<endl<<n<<"NUmber is not palindrome";

}

Output

palindrome number

Avatar

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of