Answers for "get a string input from user and check palindrome or not in c"

C
1

check if string is palindrome in c

// this is for string

#include <stdio.h>
#include <string.h>

void main()
{
  char a[100], b[100];

  printf("Enter a string to check if it's a palindrome: ");
  gets(a);

  strcpy(b, a);

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

  else
    printf("\nThe string is not palindrome.\n");

  getch();
}
Posted by: Guest on June-23-2021

Code answers related to "get a string input from user and check palindrome or not in c"

Code answers related to "C"

Browse Popular Code Answers by Language