How to write a C Program to Check Given String is Palindrome or Not in C Programming Language ?
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- void main()
- {
- char a[10],b[10];
- clrscr();
- printf("\nEnter a string: ");
- gets(a);
- strcpy(b,a);
- strrev(b);
- if(strcmp(a,b)==0)
- {
- printf("%s is palindrom",a);
- }
- else
- {
- printf("%s is not palindrom",a);
- }
- getch();
- }