You Are The Visitor Number

Saturday, May 17, 2008

/* Program to show Number is a Palindrome*/

Here is the Program of the series that tell a number is pallindrome or not , a number is pallindrome if it has same digits when we read it from first digit or last digit. For example 12121 is a pallindrome number & a number 1212 is not a pallindrome.

Try this program by some examples from your side…..

Remember Dear C is not for FEAR…..

/* Program to show No. is a Palindrome */

/*Author: Mitochondria Technologies Inc.*/

#include<stdio.h>

#include<conio.h>

void main()

{

int temp,rev=0,rema,num;

clrscr();

printf("Enter the no. which is to be Checked : ");

scanf("%d",&num);

temp=num;

rev=0;

while(num>0)

{

rema=num%10;

num=num/10;

rev=rev*10+rema;

}

if (temp==rev)

{

printf("The given no. is Palindrome");

}

else

{

printf("The Given No. is Not Palindrome");

}

getch();

}


 

No comments: