C Program to check whether a number is palindrome or not| E-studyblog|
C Program to check whether a number is palindrome or not| E-studyblog| |
What is palindrome number ?
An Integer is said to be palindrome if the reverse number remains the same of that given number.
Example: 1001 is a palindrome number
1234 is not a palindrome number
Example: 1001 is a palindrome number
1234 is not a palindrome number
C Program to check whether a number is palindrome or not:
#include<stdio.h>
int main(){
int n,s=0;
printf("\nEnter the Integers:");
scanf("%d",&n);
int k=n;
while(n>0)
{
int d=n%10;
s=(s*10)+d;
n=n/10;
}
//if k and s are equal
if(k==s)
printf("\nThe number is palindrome number:");
else
printf("\nThe number is not palindrome number:");
return 0;
}
OUTPUT:
I hope you have read our Article and you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. Thank you!
No comments:
Post a Comment
If you have any queries ,please let us know