Tuesday, 20 January 2015

Program to find Palindrome in c++

//Program to find Palindrome in c++

#include<iostream.h>
#include<conio.h>
void main()
{
 int a,b,p;
 int i=0;
 clrscr();
 cout<<"Enter a number to check palindrome:\n";
 cin>>a;
 p=a;
 while(a!=0)
  {
   b=a%10;
   a=a/10;
   i=(i*10)+b;
  }
 if(i==p)
 cout<<"Number is Palindrome";
 else
 cout<<"Number is Not Palindrome";
 getch();
}

No comments:

Post a Comment

Read contacts in iOS using Swift with error handling

Just copy and paste the below code Pre-step before pasting the below code Add below line in AppDelegate.swift file below import statement ...