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 ios in c++?

1230


What are static type checking?

1067


What is buffering in c++?

1072


What is a multimap c++?

1225


What is istream c++?

1207


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

968


What is atoi in c++?

1084


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

2401


What is the difference between struct and class?

1582


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

1075


Comment on assignment operator in c++.

1129


What are the advantages of pointers?

1078


What is unary operator? List out the different operators involved in the unary operator.

1013


What is == in programming?

1044


Explain what is polymorphism in c++?

1139