Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

C program to check a number is Palindrome or not



In this C-program we will check the number is Palindromecolor> or not. The number will be taken from the user.color>

input:

The number(i.e : 567,610,7899 etc.)

output:

The number will be Palindrome or not

CODE---->


#include
#include
color> void main()color>
{
int b,a=0,r=0,n;
clrscr();
printf("Please,Enter a number:color>");
scanf("%dcolor>",&n);
b=n;
while(n!=0color>)
{
r=n%10;
a=a*10+r;
n=n/10;
}
if(b==acolor>)
printf("\n%d is a Palindrome number.color>",a);
else
printf("\n%d is not a Palindrome number.color>",a);
getch();
}



Don't just read, write it, run it.....color>

RESULT:color>








This post first appeared on ProgramJoy.blogspot.com, please read the originial post: here

Share the post

C program to check a number is Palindrome or not

×

Subscribe to Programjoy.blogspot.com

Get updates delivered right to your inbox!

Thank you for your subscription

×