PALINDROME NUMBER
Code :
#include<stdio.h>
int main()
{
int num, rev=0,temp, rem;
printf("========================================\n");
printf("\tPALINDROME NUMBER\n");
printf("========================================\n");
printf("Enter any number : ");
scanf("%d", &num);
temp = num;
printf("\n");
while(temp != 0)
{
rem = temp%10;
rev = (rev * 10) + rem;
temp /= 10;
}
if(rev == num)
{
printf("%d is Palindrome Number.\n", num);
}
else
{
printf("%d is Not Palindrome Number.\n",num);
}
printf("----------------------------------------\n");
return 0;
}
Come again Learn again !
« iCodeBuzz »
No comments:
Post a Comment