C Program to Check Whether a Number is Palindrome or Not


A palindrome number is one that remains the same on reversal. Example- 121, 434

  1. //C program to check palindrome
  2. #include <stdio.h>
  3. int main() {
  4. int no, no1, rev = 0, remr;
  5. printf("Enter any number: ");
  6. scanf("%d", &no);
  7. no1 = no;
  8. while (no > 0){
  9. remr = no % 10;
  10. rev = rev * 10 + remr;
  11. no = no/ 10;
  12. }
  13. if (no1 == rev){
  14. printf("Given number is a palindromic number");
  15. }
  16. else{
  17. printf("Given number is not a palindromic number");
  18. }
  19. return 0;
  20. }

Output

Output!