#include<stdio.h>
#include<conio.h>
void main()
{
int num,no,i,rem,reverse=0;
clrscr();
printf("Enter the number:");
scanf("%d",&num);
no=num;
while(num! = 0)
{
rem = num % 10;
reverse = reverse * 10 + rem;
num= num / 10;
}
printf("Reversed number is %d",reverse);
if(no==reverse)
{
printf("Number is palindrome");
}
else
{
printf("Number is not palindrome:");
}
getch();
}
#include<conio.h>
void main()
{
int num,no,i,rem,reverse=0;
clrscr();
printf("Enter the number:");
scanf("%d",&num);
no=num;
while(num! = 0)
{
rem = num % 10;
reverse = reverse * 10 + rem;
num= num / 10;
}
printf("Reversed number is %d",reverse);
if(no==reverse)
{
printf("Number is palindrome");
}
else
{
printf("Number is not palindrome:");
}
getch();
}
To find whether the given number is palindrome or not. |
To find whether the given number is palindrome or not. |
No comments:
Post a Comment