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 / abhinav garg

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
int palindrome(char str[30],int len);
void main()
{ clrscr();
char str[50];
int len,a;
cout<<"Enter a string:";
gets(str);
len=strlen(str);
cout<<"\nLength of the string=>"<<len;
a=palindrome(str,len);
if(a==1)
cout<<"\n String is palindrome...";
else
cout<<"\n String is not a palindrome...";
getch();
}

int palindrome( char str[30],int len)
{ int flag=0,i;
for( i=0;i<len/2;i++)
{
if(str[i]==str[len-i])
flag=1;
}
return flag;
}

Is This Answer Correct ?    10 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c strings syntax?

1093


Describe the process of creation and destruction of a derived class object?

1086


Can non-public members of another instance of the class be retrieved by the method of the same class?

1049


What do you mean by public protected and private in c++?

1015


Why is c++ called oops?

1103


Explain "const" reference arguments in function?

1012


Is arr and &arr are same expression for an array?

1023


What are pointer-to-members? Explain.

1087


What is the difference between object-oriented programming and procedural programming?

1175


What is the most powerful coding language?

1017


Difference between class and structure.

1127


What is pointer with example?

994


Is c++ a low level language?

935


What is a node class in c++?

1038


What is a down cast?

1063