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

What are guid? Why does com need guids?

1113


Which coding certification is best?

1077


Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

1132


What is c++ runtime?

1153


Is main a class in c++?

1048


Which one is better- macro or function?

1278


Should a constructor be public or private?

1086


What is tellg () in c++?

1360


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

1296


What are the uses of pointers?

1134


Differentiate between a constructor and a destructor in c++.

1052


Does dev c++ support c++ 11?

1086


What is nested class in c++?

1014


Does c++ have foreach?

1131


What operator is used to access a struct through a pointer a) >> b) -> c) *

1162