APC-PRAC-016.c (709B)
1 /* Write a program to check palindrome number. */ 2 // File Name - amit0611202502.c (LAB), APC-PRAC-016.c (Local) 3 4 // This code has not been compiled. 5 // If you find any issues, please create a new issue on GitHub regarding them. 6 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues 7 8 #include <stdio.h> 9 10 int main() 11 { 12 int num, temp, rev = 0; 13 printf("Enter the number : "); 14 scanf("%d", &num); 15 temp = num; 16 while (temp > 0) 17 { 18 rev = (rev * 10) + (temp % 10); 19 temp /= 10; 20 } 21 if (rev == num) 22 printf("\nInput %d is a palindrome number.", num); 23 else 24 printf("\nInput %d is not a palindrome number.", num); 25 return 0; 26 }