Program to Check the number is whether palindrome or not | C++ Programming

Program to Check the number is whether palindrome or not | C++ Programming
//Program to Check the number is whether palindrome or not
#include<iostream.h>
#include<conio.h>
#include<math.h>
 void main()
{clrscr();
 long num,res=0,ori,c;
 cout<<"\n Enter the number:";
 cin>>num;
 ori=num;
 while(num>0)
 {
  c=num %10;
  res=res*10+c;
  num=num/10;
 }
 if(ori==res)
   cout<<"\n The entered number is palindrome";
 else
     cout<<"\n The entered number is not palindrome";
 getch();
}
Program to Check the number is whether palindrome or not | C++ Programming Program to Check the number is whether palindrome or not | C++ Programming Reviewed by SHERE KHOJRAHA on February 13, 2019 Rating: 5

No comments:

Powered by Blogger.