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 / anonymous

#include<stdio.h>
#include<stdlib.h>
main()
{
int i,j,len=0;
char name[25];
printf("Enter the string");
scanf("%s",&name);
while(name[len]!='\0')
len++;
printf("\n%d",len);
for(i=0,j=len-1;i<len/2;i++,j--)
{
if(name[i]!=name[j])
{
printf("The string is not a palindrome");
exit(0);
}
}
else
{
printf("The string is a palindrome");
}
}
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you define/declare constants in c++?

1054


How did c++ get its name?

1034


What is virtual methods?

1125


Do you need a main function in c++?

1124


Is it possible to get the source code back from binary file?

1367


How do you sort a sort function in c++ to sort in descending order?

998


What is DlgProc?

1029


What is the basic structure of c++ program?

1102


Who created c++?

1065


How will you call C functions from C ++ and vice-versa?

1145


What is function overriding in c++?

1071


How would you use the functions sin(), pow(), sqrt()?

1189


Describe public access specifiers?

1111


What are the methods of exporting a function from a dll?

1233


What happens if a pointer is deleted twice?

1276