#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
char a[10],b[10];
clrscr();
printf("\nEnter a string: ");
gets(a);
strcpy(b,a);
strrev(b);
if(strcmp(a,b)==0)
{
printf("%s is palindrom",a);
}
else
{
printf("%s is not palindrom",a);
}
getch();
}
#include <conio.h>
#include <string.h>
void main()
{
char a[10],b[10];
clrscr();
printf("\nEnter a string: ");
gets(a);
strcpy(b,a);
strrev(b);
if(strcmp(a,b)==0)
{
printf("%s is palindrom",a);
}
else
{
printf("%s is not palindrom",a);
}
getch();
}
No comments:
Post a Comment