Code Competitions

Coding competition
Showing posts with label palindrome. Show all posts
Showing posts with label palindrome. Show all posts

Sunday, 12 May 2013

Program to check the number is palindrome or not?

#include<stdio.h>
#include<conio.h>
void main()
{
    int a,b,c,rev=0;
    printf("enter the number");
    scanf("%d",&a);
    c=a;
    while(a>0)
    {
        b=a%10;
        a=a/10;
        rev=rev*10+b;
    }
    if(c==rev)
    {
        printf("\n number is palindrome");
    }
    else
    {
        printf("\n number is not a palindrome");
    }
    getche();
}