You are on page 1of 1

#include<iostream> using namespace std; int main() { int num, rev=0; cout<<"Enter number: "; cin>>num; int count=0,

n=0, temp=num, t[100]; for(int i=1;num!=0;i++){ n=num%10; num=num/10; rev=n+(rev*10); t[i]=n; count++; } if(rev==temp){ cout<<temp<<" is a Palindrome Number"; } else{ cout<<temp<<"is NOT a Palindrome Number"; } if (count%2!=0) { count=(count/2)+1; cout<<"The middle number is: <<t[count]; } return 0; }

You might also like