string pelindrome or not

#include <stdio.h>
#include <string.h>
int main()
{
  char a[100], b[100];

  printf("Enter a string to check if it is a palindrome or not \n");
  gets(a);

  strcpy(b, a);
  strrev(b);

  if (strcmp(a, b) == 0)
    printf("The string is a palindrome.\n");
  else
    printf("The string is not a palindrome.\n");

  return 0;
}


OUTPUT : - 




For Other Programs Visit The WebSite:-   https://www.techapurba.com/

Follow Me On Social Media :-

For tech related videos visit my other website :- https://apurbatechinfo.blogspot.com/

Post a Comment

0 Comments