Palindrome Number

C Programming

C Programming Examples

#include<stdio.h>

int main() {
	int no, temp, palindrome = 0;
	printf("Check the given number is Palindrome or not\n");
	printf("Enter a Number:\n");
	scanf("%d", &no);
	temp = no;

	/* Loop the process using "While loop" */
	while(no != 0) {
		palindrome = palindrome * 10;
		palindrome = palindrome + (no % 10);
		no = no / 10;
	}
	if(temp == palindrome)
		printf("It's a Palindrome Number!\n");
	else
		printf("It's not a Palindrome Number!\n");
	return 0;
}


          /****** Output ******/
          

Check the given number is Palindrome or not

Enter a number:

121

It's a Palindrome Number!


----------------------------------


Check the given number is Palindrome or not

Enter a number:

128

It's not a Palindrome Number!

Learn more about Palindrome Number