Commit 007eb24e authored by Mikayel Ghaziyan's avatar Mikayel Ghaziyan

Mikayel Ghaziyan e4.26 Version 4

parent a73dea33
......@@ -6,17 +6,17 @@ main()
int number;
std::cin >> number;
int initialNumber = number; ///To store the initial value
int reverse = 0;
int reverse = 0;
while (number != 0) {
int digit = number % 10;
reverse = (reverse * 10) + digit;
number = number / 10;
int digit = number % 10;
reverse = (reverse * 10) + digit;
number = number / 10;
}
if(reverse == initialNumber) {
std::cout << "The number is polindrome" << std::endl;
if (reverse == initialNumber) {
std::cout << "The number is polindrome" << std::endl;
} else {
std::cout << "The number is not polindrome" << std::endl;
std::cout << "The number is not polindrome" << std::endl;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment