Docstoc

palindrome - DOC

Document Sample
palindrome - DOC Powered By Docstoc
					#include<iostream.h>
#include<conio.h>
#include<string.h>
int main()
{
 char string[80],c;
 clrscr();
 cout<<"Enter String :";
 cin>>string;
 int i,j,l,flag=1;
 l=strlen(string);
 for(i=0,j=l-1;i<l/2;i++,j--)
  {
   if(string[i]!=string[j])
   {
    flag=0;
    break;
   }
  }

    if(flag)
     cout<<"It is a palindrome\n";
    else
     cout<<"It is not a palindrome";
    getch();
    return 0;
}

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:5
posted:10/17/2012
language:
pages:1
Description: C programming, C programming