Samiul_Islam_Abir

008

Jul 25th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   char a[100], b[100];
  6.  
  7.   printf("Enter string\n");
  8.   gets(a);
  9.  
  10.   strcpy(b, a);
  11.   strrev(b);
  12.  
  13.   if (strcmp(a, b) == 0)
  14.     printf("The string is a palindrome.\n");
  15.   else
  16.     printf("The string isn't a palindrome.\n");
  17.  
  18.   return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment