Monday, March 26, 2012

Program to check whether given string is palindrome or not


/*****************<soeasyprograms.blogspot.in>******************/
/*Program to check whether given string is palindrome or not*/

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
       char a[50],b[50];
       clrscr();
       printf("Enter the string\n");
       gets(a);
       strcpy(b,a);
       strrev(a);
       if(strcmp(b,a)==0)
       {
        printf("The given string is palindrome");
        }
        else
        {
        printf("The given string is not palindrome");
        }
     getch();
}
/*****************<soeasyprograms.blogspot.in>******************/


No comments:

Post a Comment