Description
Palindrome : A palindrome number is palindrome number is after reverse number is same.
For Example : 17671 is reversed also same 17671. So this is palindrome.
Now let's write the code...
#include<stdio.h>
int main()
{
int n;
printf("Enter the number do you want to check palindrome or not : ");
scanf("%d", &n);
int temp = n;
int rev = 0, last_digit;
while(n>0){
last_digit = n % 10;
rev = rev * 10 + last_digit;
n = n / 10;
}
if(temp==rev){
printf("%d is Palindrome", temp);
}else{
printf("%d is Not Palindrome", temp);
}
return 0;
}
Output :
Enter the number do you want to check palindrome or not : 1661
1661 is Palindrome
Recommended Posts
Pascal Triangle | C programming
pascal triangle program in c | Write a c program to print the pascal triangle.
Leap Year | Leap year program in c
Year is divisible by completely 4,100,400 then called that year is leap year.
Perfect Number in C Programming
What is Perfect Number? Perfect Number is a positive integer number that is equal to the sum of the its possible factors.
For Example : 6 is a Perfect Number
Strong Number in C programming | What is Strong Number
Strong Number is a number whose sum of the factorial of digits of number is equal to given number.
For Example : 145 is a strong number.
Neon Number | c programming language
A neon number is a number if the sum of the square of that number is equal to the actual number, then it is a neon number. For Example : 9 is a neon number.
C programming restaurant menu code | @lapmos
In this tutorial we write a c program which print the menus of restaurant with product and price.