programming-examples/c/Basic/Write a c program to check given string is palindrome number or not.c
2019-11-18 14:44:36 +01:00

18 lines
444 B
C

#include <stdio.h>
#include <conio.h>
void main() {
char *a;
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("\nTHE STRING IS PALINDROM"); else
printf("\nTHE STRING IS NOT PALINDROM");
getch();
}