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 is a multiset c++?

1144


What is the use of bit fields in structure declaration?

982


Is it possible for the objects to read and write themselves?

1097


what are the iterator and generic algorithms.

1936


Is java made in c++?

1059


What are the various compound assignment operators in c++?

977


Specify different types of decision control statements?

850


What are containers in c++?

988


What is ios :: in in c++?

1068


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

1076


How can we read/write Structures from/to data files?

1125


What is the function to call to turn an ascii string into a long?

1061


Define namespace in c++?

1043


Comment on c++ standard exceptions?

1069


why and when we can declar member fuction as a private in the class?

2072