#include<stdio.h>
int main()
{
int i,n,sum=0,rem,copy;
printf("Enter any number to check the given number is palindrome or not\n");
scanf("%d",&n);
copy = n;
while(n>0)
{
rem = n % 10;
sum = sum * 10 + rem;
n = n / 10;
}
if(copy = = sum)
{
printf("The given %d number is Palindrome",copy);
}
else
{
printf("The given %d number is Not Palindrome",copy);
}
return 0;
}
INPUT 1:
Enter any number to check the given number is palindrome or not
121
OUTPUT 1:
The given 121 number is Palindrome
INPUT 2:
Enter any number to check the given number is palindrome or not
1331
OUTPUT 2:
The given 1331 number is Palindrome
INPUT 3:
Enter any number to check the given number is palindrome or not
1231
OUTPUT 3:
The given 1231 number is Not Palindrome
Monday, December 17, 2018
Home
/
C Programming
/
Simple Programs
/
WAP in C to check whether a given number is Palindrome or Not
WAP in C to check whether a given number is Palindrome or Not
Topics
# C Programming
# Simple Programs
About HindiKisseKahaniyaan
Easy Programming All is a free blogger to the students who wants to learn programming in C, HTML, CSS, Bootstrap, Web Designing from home. The students can learn programming free of cost at their home. We provide best logics about any program. If you want to ask any logic of any program you can comment to us in comment box.
Simple Programs
Labels:
C Programming,
Simple Programs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment