Tuesday 10 January 2012

String Palindrome using String Function

#include<stdio.h>
#include<conio.h>

void main()
{
    char a[100],b[100];
    clrscr();
    printf("Enter the String::\n");
    gets(a);
    strcpy(b,a);
    strrev(b);
    if(strcmp(a,b)==0)
    {
        printf("\nString is Palindrome");
    }
    else
    {
        printf("\nString is not palindrome");
    }
    getch();
}

No comments:

Post a Comment