123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
#include <iostream> #include <cmath> #include <ctime> #include <iomanip> #include <fstream> #include <string> using namespace std; int reverse(int num) { int reverse = 0; while (num != 0) { int remainder = num % 10; reverse = reverse * 10 + remainder; num /= 10; } return reverse; } bool isPalindrome(int number) { if (number == reverse(number)) { number = true; cout << "It is a palindrome!"; } else { number = false; cout << "It is not a palindrome!"; } return number; } int main() { bool isPalindrome(int number); int number = 0; cout << "Enter a number: "; cin >> number; cout << "Reversed number = " << reverse(number) << endl; cout << isPalindrome; return 0; }