Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

Checking Given Integer is Palindrome or Not

Checking Given Integer is Palindrome or Not

According to  A Palindrome is a word, phrase, number, or
other sequence of characters which reads the same backward or forward.
Allowances may be made for adjustments to capital letters, punctuation,
and word dividers. So I am going to to show how to check whether a given integer is  Palindrome or Not using C.Environment:
OS- Linux (kubuntu 16.04)
Compiler – GCC
IDE -Codeblock

include <stdio.h>
To check if a string is a palindrome or not,
a string needs to be compared with the reverse of itself.

int main(){
int n;
int reverseno = 0;
int remainder;
int originalno;

printf("Please enter a integer :");
originalno = n;

remainder= n%10;
reverseno= reverseno *10 +remainder;

if(originalno == reverseno)
printf("%d is a palindrome.", originalno);
printf("%d is not a palindrome.", originalno);
return 0;

Screen shot :

You can do it palindrome  check in any language like PHP, Javascript, Python, Ruby , Java , just change the code little bit .