/*WAP in C to check a number is palindrome(madam) or not*/ //125 != 521 => not palindrome, 121=121 => palindrome #include int main () { int n, m, r, d=0; printf ("\nEnter the number: "); scanf ("%d", &n); m = n; //duplicating the value of n in m while (n!=0) { //these operations inter-change(swap) the positions e.g. 125 as 521. r = n % 10; d = d * 10 + r; n = n / 10; } if (m == d) printf ("\nAs %d = %d. Therefore %d is a palindrome no.", m ,d, m); else printf ("As %d != %d. Therefore %d is not palindrom no.", m ,d, m); return 0; }