View Single Post
Old 29-10-2007, 07:37 AM   #361 (permalink)
Gigacore
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default 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...

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();
}
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline