Code:
#include<stdio.h>
int main()
{
int number,result=0,temp=0;
scanf("%d",&number);
temp=number;
while(number!=0)
{
result=result*10;
result=result+number%10;
number=number/10;
}
printf("%d",result);
if(result==temp)
{
printf("its palindrome number ");
}
else
{
printf("its not palindrome number");
}
return 0;
}
#include<stdio.h>
int main()
{
int number,result=0,temp=0;
scanf("%d",&number);
temp=number;
while(number!=0)
{
result=result*10;
result=result+number%10;
number=number/10;
}
printf("%d",result);
if(result==temp)
{
printf("its palindrome number ");
}
else
{
printf("its not palindrome number");
}
return 0;
}
Output
0 Questions:
Post a Comment