Palindrome number:-
#include <stdio.h>
main()
{
int n, n1, rev = 0, rem;
printf("Enter any number: \n");
scanf("%d", &n);
n1 = n;
while (n > 0)
{
rem = n % 10;
rev = rev * 10 + rem;
n = n / 10; }
if (n1 == rev)
{
printf("Given number is a palindromic number");
}
else
{
printf("Given number is not a palindromic number");
}
return 0;
}
0 comments:
Post a Comment