Check Whether a Number is Palindrome or Not in C Program



Other Related Topic

ARMSTRONG NUMBER IN C PROGRAM (CLICK HERE)

Positive Negative or Zero (Click Here)

/*Palindrome or Not*/
#include<stdio.h>
	main()
	{
		int n,r,sum=0,temp;
		printf("Enter any number:");
		scanf("%d",&n);
		temp=n;
		while(n>0)
		{
			r=n%10;
			sum=sum*10+r;
			n=n/10;
		}
			if(temp==sum)
			printf("Palindrome");
			else
			printf("Not Palindrome");
	}

Leave a Reply

Your email address will not be published. Required fields are marked *