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

Out of fgets() and gets() which function is safe to use?

1195


What is heap sort in c++?

1135


Is c++ the hardest language?

1033


Which c++ operator cannot overload?

1075


What are the sizes and ranges of the basic c++ data types?

1099


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

1001


What can c++ be used for?

1162


What is virtual base class?

1131


What does new in c++ do?

1069


What are the advantages of early binding?

1117


Explain the concept of friend function in c++?

1161


What's c++ used for?

1159


Tell me an example where stacks are useful?

1098


What are guid?

1305


Can you write a function similar to printf()?

1189