Translate

Labels

Saturday 29 December 2012

FINDING THE STRING IS PALINDROME OR NOT

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<conio.h>
void main()
{
char st[50], p[50];
clrscr();
printf("Enter the string:");
scanf("%s",st);
strcpy(p,st);
strrev(p);
if(strcmp(p,st)= =0)
printf("\n\n The given string is palindrome");
else
printf("\n\n The given string is not palindrome");
getch();
}

No comments: