Dear Students ,
Q. Do you know ? What is Palindrome number ?
Ans . If yes , then good otherwise no worry .
Let's See . What is Palindrome number .
Palindrome Numbers are those number which we could read from any side either left or right but value are same .
Example :
num=123454321
Let's see example with program.
#include<stdio.h>
#include<conio.h>
void main()
{
int num,temp,rem,sum=0;
printf("Enter your Number : ");
scanf("%d",&num);
temp=num;
while(num>0)
{
rem=num%10;
sum=sum*10+rem;
num=num/10;
}
if(sum==temp)
{
printf("Number is Palindrome ");
}
else
{
printf("Number is not Palindrome ");
}
getch();
}
Q. Do you know ? What is Palindrome number ?
Ans . If yes , then good otherwise no worry .
Let's See . What is Palindrome number .
Palindrome Numbers are those number which we could read from any side either left or right but value are same .
Example :
num=123454321
Let's see example with program.
#include<stdio.h>
#include<conio.h>
void main()
{
int num,temp,rem,sum=0;
printf("Enter your Number : ");
scanf("%d",&num);
temp=num;
while(num>0)
{
rem=num%10;
sum=sum*10+rem;
num=num/10;
}
if(sum==temp)
{
printf("Number is Palindrome ");
}
else
{
printf("Number is not Palindrome ");
}
getch();
}
very Nice
ReplyDelete