0

Error In C++ Compile

Palindrome Problem #include <iostream> using namespace std; bool isPalindrome(int x) { //complete the function int num; num = x; int remainder = 0; int reversed = 0; while (num != 0){ remainder = num % 10; reversed = (reversed * 10) + remainder; num = num / 10; } return x == reversed; int main() { int n; cin >>n; if(isPalindrome(n)) { cout <<n<<" is a palindrome"; } else { cout << n << " is NOT a "; } return 0; }

3rd Dec 2022, 8:22 PM
Brian
2 Answers
+ 1
Missing a closing curly bracket for isPalindrome function !
3rd Dec 2022, 8:27 PM
Abhay
Abhay - avatar
+ 1
You are missing a curly bracket in the isPalindrome function.
9th Dec 2022, 8:30 PM
Elliot King