P043.c (598B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Write a program to check palindrome number. */ 8 9 #include <stdio.h> 10 int main() 11 { 12 int num, temp, rev; 13 printf("Enter the number : "); 14 scanf("%d", &num); 15 temp = num; 16 rev = 0; 17 while (temp > 0) 18 { 19 rev = (rev * 10) + (temp % 10); 20 temp /= 10; 21 } 22 if (num == rev) 23 { 24 printf("%d is a palindrome number.", num); 25 } 26 else 27 { 28 printf("%d is not a palindrome number.", num); 29 } 30 return 0; 31 }