C program to find that given string is palindrome or not.

#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();
}

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students