palindrome number in C - Jagrav Education
BANNER 728X90

Monday, April 22, 2019

palindrome number in C

  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.    int n, rev = 0, t;
  6.  
  7.    printf("Enter a number to check if it is a palindrome or not\n");
  8.    scanf("%d", &n);
  9.  
  10.    t = n;
  11.  
  12.    while (!= 0)
  13.    {
  14.       rev = rev * 10;
  15.       rev = rev + t%10;
  16.       t = t/10;
  17.    }
  18.  
  19.    if (== rev)
  20.       printf("palindrome number is =%d .\n", n);
  21.    else
  22.       printf("%d isn't a palindrome number= %d.\n", n);
  23.  
  24.    return 0;
  25. }

you can check result online

No comments:

Post a Comment

Divi read more Text replace with custom text in divi builder via JS Query simple code in wordpress

  use simple JS Query for replace text  <script type="text/javascript"> (function($) { $(document).ready(function() { var ne...