Write a function to check if a number is a palindrome.
MediumProblem Statement
Write a function to check if a number is a palindrome.
Sample Input
12321
Sample Output
12321 is a palindrome
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
int isPalindrome(int num) {
// Your code here
}
int main() {
int num = 12321;
if (isPalindrome(num)) {
printf("%d is a palindrome\n", num);
} else {
printf("%d is not a palindrome\n", num);
}
return 0;
}
Input
12321
Expected Output
12321 is a palindrome