0
Can you tell me why are they saying to try again after completion of this code, is there any mistake?
#include <iostream> using namespace std; bool isPalindrome(int x) { //complete the function return x; } int main() { int n; cin >>n; if(isPalindrome(n)) { cout <<n<<" is a palindrome"; } else { cout << n<<" is NOT a palindrome"; } return 0; }
2 Antworten
+ 1
What is the code you added to complete this task?
x is integer. And it is passed value which you just returning same..!!
You need to return true or false...
+ 1
There is a function (ispalindrome) in which you need write the logic to check the number is palindrome or not. and return the result. result can be in the boolean form
Palindrome number are those numbers which are equal after reversing them.