- #include<iostream>
- using namespace std;
- int main()
- {
- int palindrome, reverse=0;
- cout<<"Enter number: ";
- cin>>palindrome;
- int num=0,key=palindrome;
- for(int i=1;palindrome!=0;i++){
- num=palindrome%10;
- palindrome=palindrome/10;
- reverse=num+(reverse*10);
- }
- if(reverse==key){
- cout<<key<<" is a Palindrome Number";
- }
- else{
- cout<<key<<"is NOT a Palindrome Number";
- }
- return 0;
How to Learn a Programming Language. If you have an interest in creating computer programs, mobile apps, websites, games or any other piece of software. Learn the fundamentals of programming, explore programs made by others. Write your own programs and share them.
Saturday, 20 December 2014
Find Palindrome number in c++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment