Sunday 23 November 2014

Source code of to find the palindrome with output screen.






#include "stdafx.h"
#include <iostream>
using namespace std;


int main()
{

  int num,temp,rem,sum=0;
  cout<<"Enter the number ";
  cin>>num;
  temp=num;
  while(num>0)
  {
rem=num%10;
num=num/10;
sum=(sum*10)+rem;
  }
  if(temp==sum)
 cout<<"The number is palindrome"<<sum;
  else
 cout<<"The number is not palindrome";
 
cout<<endl;
  system("pause");
return 0;
}

----------------------------------------------------
The output of this programme is:
palindrome programme

palindrome programme

0 comments:

Post a Comment