My Subject Blog

C Program Palindrome

/*  Write a program to find whether a number is palindrome or not. */

#include <stdio.h>

int main(void) {
int no,sum=0,temp;
printf("Enter Number : ");
scanf("%d",&no);
temp=no;
while(no>0)
{
sum = (sum * 10)+(no % 10);
no = no / 10;
}
if(temp == sum)
{
printf("\n %d is Palindrome",temp);
}
else
{
printf("\n %d is not Palindrome",temp);
}
return 0;
}

Comments

Most Visited Post

C Program to Find Largest Odd Number from Array

C Program for Runtime Memory Allocation for Table of Integers

Followers