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 are the events occur in intr activated on interrupt vector table

1758


What are special characters c++?

1032


Why use of template is better than a base class?

1189


Differentiate between a copy constructor and an overloaded assignment operator.

1092


Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

1154


What is c++ good for?

1067


What do you mean by early binding?

1072


What is ios in c++?

1223


Is there structure in c++?

1033


How new/delete differs from malloc()/free?

1148


Can you please explain the difference between static and dynamic binding of functions?

1036


Which is the best c++ software?

1105


What is the purpose of template?

1115


What is an html tag?

1150


What is the difference between the compiler and the preprocessor?

1125