Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write program for palindrome

Answer Posted / deepanjan

#include<stdio.h>
void main()
{
char ch[100];
int i,j,l,flag;
l=0;
flag=0;
printf("\n Enter to check if palindrome or not \n");
gets(ch);
for(i=0;ch[i]!='\0';i++)
{
l++;
}
for(i=0,j=l-1;i<(l/2)-1,j>(l/2);i++,j--)
{
if(ch[i]==ch[j])
flag=0;
else
{
flag=1;
break;
}
}
if(flag==0)
printf("\n Entered characters are palindrome");
else
printf("\n Entered characters are not a palindrome");

}

Is This Answer Correct ?    14 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are containers in c++?

988


What is stack unwinding?

1135


Write a program which uses Command Line Arguments

1174


Is c++ the most powerful language?

1075


What are the effects after calling the delete this operator ?

1050


Is c++ map a hash table?

1018


What is the best book for c++ beginners?

1040


Is c++ still in demand?

1146


What is the difference between #import and #include in c++?

1104


What is function overriding in c++?

1061


What is public, protected, private in c++?

1145


What is a constructor and how is it called?

1044


what does the following statement mean? int (*a)[4]

1078


Are c and c++ different?

977


Describe linkages and types of linkages?

993