C program to check whether a string is palindrome or not using string functions. | C प्रोग्राम यह जांचने के लिए है कि क्या कोई स्ट्रिंग पैलिंड्रोम है या स्ट्रिंग फ़ंक्शन का उपयोग नहीं कर रहा है।












C program to check whether a string is palindrome or not using string functions.




C program to check whether a string is palindrome or not using string functions.



#include <stdio.h> #include <string.h> #define MAX 100 int main() { char text[MAX], res[MAX]; int test; printf("Enter any string: "); gets(text); strcpy(res, text); strrev(res); test = strcmp(text, res); if(test == 0) { printf("\n Enter String is Palindrome."); } else { printf("\n Enter String is Not Palindrome."); } return 0; }


Output:
Enter any string: rama String is Not Palindrome. Enter any string: madam String is Palindrome.



Exercise: 1
C program to check whether a string is palindrome or not.