Monday 26 September 2016

C++ Program to Check Whether a Number is Palindrome or Not

CODINGCLASSES|LEARNTOPROGRAM


PALINDROME NUMBER IN C++


e.G


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
 char coding,classes,learn,program=0;
cout<<"Enter the positive number From own wish ";
cin>>classes;
coding = classes;
do
{
      learn = classes%10;
      program = (program*10)+learn;
     classes =classes/10;
while(classes!=0 )
cout<<"THE NUMBER IS REVERSE ORDER WHICH U INPUT "<<classes<<endl;
}
if(coding==program )
{
cout<<"This is the palimdrom no ";
}
else
{
cout<<"this is not a palimdrom number "<<endl;
}
cout<<"You choose wrong number   - Try Again buddy ";
getch();
}}



OUTPUT OF THIS PROGRAM IS :-

Enter the positive number From own wish 12321


THE NUMBER IS REVERSE ORDER WHICH U INPUT 12321

 this is the palindrome number



                                                   

            KEEP SMILING!! KEEP CODING!!


No comments:

Post a Comment