Skip to content

Instantly share code, notes, and snippets.

@ThePratikSah
Created July 17, 2017 17:42
Show Gist options
  • Save ThePratikSah/d2352eaddd28292d28e840f4ac9410db to your computer and use it in GitHub Desktop.
Save ThePratikSah/d2352eaddd28292d28e840f4ac9410db to your computer and use it in GitHub Desktop.
main() {
int num, temp, digit, rev_num=0;
printf("Enter any number:\n");
scanf("%d", &num);
temp=num;
while(num!=0){
digit=num % 10;
rev_num=(rev_num*10)+digit;
num=num/10;
}
if (rev_num==temp)
printf("Palindrome");
else
printf("Not palindrome.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment