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 / md. irshad alam

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
int palind(char []);
int r;
char name[5];
cout<<"Enter a String...";
gets(name);
r=pal(name);
if(r==0)
{
cout<<"\n"<<"PALINDROME...";
}
else
{
cout<<"\n"<<"NOT A PALINDROME...";
}
getch();
}
int palind(char name[])
{
char *p,*t;
p=name;
t=name+strlen(name)-1;
while(*p)
{
if(*p != *t)
{
return(1);
}
p++;
t--;
}
return(0);
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you add an element to a set in c++?

930


Is java made in c++?

1000


What are separators in c++?

1034


Is dev c++ a good compiler?

894


What is the role of copy constructor in copying of thrown objects?

1001


Which one between if-else and switch is more efficient?

1008


What are pointer-to-members? Explain.

1063


Write a function that swaps the values of two integers, using int* as the argument type?

965


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

1156


Why do we use classes in programming?

985


What does iomanip mean in c++?

1128


Define a pdb file.

1023


What is pointer to array in c++?

1078


Who made c++?

1012


How is static data member similar to a global variable?

1048