#include<stdio.h>
#include<conio.h>
#include<string.h>
void main(){
char a[20],b[20];
int i;
clrscr();
printf("Enter a string\n");
gets(a);
strcpy(b,a);
strrev(b);
i=strcmp(a,b);
if (i==0)
printf("%s is a palindrome\n",a);
else
printf("%s is not a palindrome\n",a);
getch();
}
No comments:
Post a Comment