Advertisement
yoyo106

Palindrome (else if)

Mar 13th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     while (1)
  7.     {
  8.         int a;
  9.  
  10.  
  11.         printf("Enter a number: ");
  12.         scanf("%d",&a);
  13.         if (a%10==(a/10000)%10&&(a/10)%10==(a/1000)%10)
  14.  
  15.             printf("Your number is a palindrome!\n");
  16.         else
  17.             printf("Your number is not a palindrome!\n");
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement