Program for Number Palindrome in C

Here you will get a program for number palindrome in C.

A number is a palindrome in the event that it is equivalent to its switch.

For instance 121, 111, 1331 are palindrome numbers.

Program

#include<stdio.h>
 
int main()
{
	int n,a,b=0,num;
	printf("Enter any number:");
	scanf("%d",&n);
	num=n;
	
	while(n!=0)
	{
		a=n%10;
		b=a+(b*10);
		n=n/10;
	}
	
	if(num==b)
		printf("\nThe given number is palindrome");
	else
		printf("\nThe given number is not palindrome");
 
	return 0;
}

Output

Enter any number:12321

The given number is palindrome

Leave a Comment

error: Alert: Content is protected!!