WAP To Check The Given String Is Palindrome Or Not
#include<stdio.h>
#include<conio.h> #include<string.h> void main() { char a[100]; int i,len,flag=0; clrscr(); printf(“\nEnter A String :”); gets(a); len=strlen(a); for(i=0;i<len;i++) { if(a[i]==a[len-i-1] flag=flag+1; } if (flag==len) printf(“\n the string is palindrome”); else printf(“\n the string is not palindrome”); getch(); } |