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

#include<stdio.h>
#include<conio.h>
main()
{
char str1[20],rev[20];
int i,j=0;
clrscr();
printf("\n enter a word");
gets(str 1);
for(i=strlen(str 1)-1;i>=0;i--)
{
rev[j]=str[i];
j++;
}
rev[j]='\0';
printf("\n the given string is.........%s",str 1);
printf("\n the reversed string is .....%s",rev);
if(strcmp(str1,rev)==0)
{
printf("\n the given string is a palindrome");
}
else
{
printf("\n the given string is not a palindrome");
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

1086


What is the difference between #import and #include in c++?

1117


Explain what are accessor methods?

1131


How can virtual functions in c++ be implemented?

1141


What is the use of dot in c++?

1086


How much do c++ programmers make?

1125


What is meant by forward referencing and when should it be used?

1029


What are the unique features of C++.

1093


What's the "software peter principleā€?

1157


What is c++ coding?

1213


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1001


What are the advantages of inheritance in c++?

1109


Where is atoi defined?

1153


Where and why do I have to put the "template" and "typename" keywords?

1057


What is c++ array?

1130