Monday, June 24, 2013

Write a Program to find given no is palindrome or not ?

//Palindrome Program
#include<stdio.h>
#include<conio.h>

void main()
{
int n,no,rno=0,dno;
clrscr();
printf("enter the no");
scanf("%d",&no);
dno=no;
while(no!=0)
{
n=no%10;
rno=rno*10+n;
no=no/10;
}
if(dno==rno)
printf("the %d is palindrome ",dno);
else
printf("the %d is not palindrome",dno);
getch();
}
Output













What is Palindrome number ?
  The no is said to palindrome whose direct view and mirror view are same, example take 121 , whose mirror image is 121  so 121 is palindrome.

if have any doubt , post it on comment

Like the Post? Do share with your Friends.

No comments:

Post a Comment