C Program to Check Palindrome Number




c programming
c programming

In this example we will learn how to Check if the particular number is Palindrome or not.

C – PALINDROMIC NUMBERS Example

Palindrome number program in C

/**
C – PALINDROMIC NUMBERS Example by codebind.com
*/

#include <stdio.h>

int main()
{
  int n, reverse = 0, temp;

  printf("Enter a number to check if it is a palindrome or not\n");
  scanf("%d",&n);

  temp = n;

  while( temp != 0 )
  {
    reverse = reverse * 10;
    reverse = reverse + temp%10;
    temp = temp/10;
  }

  if ( n == reverse )
    printf("%d is a palindrome number.\n", n);
  else
    printf("%d is not a palindrome number.\n", n);

  return 0;
}


/*
OUTPUT:
Enter a number to check if it is a palindrome or not
12321
12321 is a palindrome number.

*/

Different Ways for asking same question

  • palindrome number c
  • c program for palindrome number between 1 to 1000
  • check palindrome number c
  • c code for palindrome numbers
  • palindromic numbers in c
  • generate palindrome numbers in c
  • c program for palindrome number or not
  • c palindrome number program
  • c program for palindrome number using for loop
  • c program for palindrome number using functions
  • c program for palindrome number using while loop
  • c program for palindrome number using recursion
  • c program for palindrome number using do while loop
  • c program for palindrome number with explanation
  • c program for palindrome number with output

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com





Be the first to comment

Leave a Reply

Your email address will not be published.


*