Header Ads

Header ADS

Write a program to check a number whether it is palindrome or not??

 //Write a program to check a number whether it is palindrome or not??


#include<iostream> using namespace std; int main() { int n, remainder, sum=0, original; cout<< "Enter a number = "; cin>> n; original=n; while(n!=0) { remainder = n%10; sum=(sum*10) + remainder; n=n/10; } if(original==sum) cout<< original << " is a palindrome number"; else cout<< original <<" is not a palindrome number "; }

কোন মন্তব্য নেই

Write a program to check a number whether it is palindrome or not??

  // Write a program to check a number whether it is palindrome or not?? #include<iostream> using namespace std; int ...

Blogger দ্বারা পরিচালিত.