Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool palindrom(int n) {
- int r = n % 10;
- while (n /= 10) {
- r = r * 10 + n % 10;
- }
- if (n == r) {
- return true;
- }
- }
- int main() {
- int n1;
- cout << "enter the 1st number: ";
- cin >> n1;
- int n2;
- cout << "enter the 2nd number: ";
- cin >> n2;
- cout << endl;
- if (palindrom(n1) or palindrom(n2)) {
- cout << "at least ONE of these ****ers is a palindrom";
- }
- else {
- cout << "NONE of these ****ers is a palindrom";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement