Efficient Programming

A place where you can share ideas to do a better programming. A better code. A better world :)

Saturday, July 26, 2008

Palindrome

int palindrom(const char *str)
{
int len;
int i;
len = strlen(str);
len--;
for(i=0; i < len;i++,len--)
if(str[i]!=str[len])
return 1;//not a palindrome
return 0;//a palindrome
}
Posted by Rahul Bhawsar at 10:58 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Pages

  • Data Structure & Algorithms
  • Java

Blog Archive

  • ►  2014 (1)
    • ►  May (1)
  • ►  2013 (1)
    • ►  August (1)
  • ▼  2008 (7)
    • ▼  July (7)
      • Palindrome
      • To reverse a string.
      • A program to move a circle in a box.
      • how to find HCF of two or more numbers.
      • Is there any efficient way to calulate the on bits...
      • to find whether a number is in power of 2 or not.
      • Find the sum of a series. S = 1-3+5-7+9 ... n
Simple theme. Powered by Blogger.