Program for Number Palindrome in C

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

DURGESH

I Love python, so I like machine learning a Lot and on the other hand, I like building apps and fun games I post blogs on my website for Tech enthusiast to learn and Share Information With The World.

Leave a Reply

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

18 + 14 =

Recent Content