Tuesday, 20 January 2015

Program to find whether the number is Super Palindrome or Not in C++

//Program to find whether the number is Super Palindrome or Not in C++

#include<iostream.h>
#include<conio.h>
void main()
{
 int a,b,p;
 int i=0;
 clrscr();
 cout<<"Enter a number to check Super Palindrome:\n";
 cin>>a;
 p=a;
 while(a!=0)
  {
   b=a%10;
   a=a/10;
   i=(i*10)+b;
  }
 if(i==p)
 {
  p=p*p;
  int sp,j=0,c;
  sp=p;
  while(p!=0)
   {
    c=p%10;
    p=p/10;
    j=(j*10)+c;
   }
   if(j==sp)
    cout<<"Number is Super Palindrome";
   else
    cout<<"Number is Not Super Palindrome";
 }
   else
   cout<<"Number is Not Super 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 ...