Gigacore
Dreamweaver
Re: Post ur C/C++ Programs Here
A C Program to check whether a given word is Palindrome or not.
Example for Palindromes: MADAM, MALAYALAM, LEVEL, RADAR etc...
A C Program to check whether a given word is Palindrome or not.
Example for Palindromes: MADAM, MALAYALAM, LEVEL, RADAR etc...
Code:
#include <stdio.h>
#include <string.h>
#include<conio.h>
void main()
{
char str[10],str2[10];
printf("Enter a string");
scanf("%",str1);
strcpy(str2,str1);
strrev(str2);
if(strcmp(str1,str2)==0)
printf("%s is a palindrome",str1);
else
printf("%s is not a palindrome",str1);
getch();
}