Friday, 23 December 2016

To check whether number is palindrome or not

#include<stdio.h>
#include<string.h>
main()
{
char STR[20],a[20];
int i=0,j;
printf("Enter Any String");
gets(STR);
strcpy(a,STR);
strrev(a);
j=strcmp(a,STR);
if(j==0)
printf("string is palindrome");
else
printf("String is not palindrome");
}

No comments:

Post a Comment

Amazon1Ads