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

When is the destructor called?

1025


Should you pass exceptions by value or by reference?

1133


Are there any special rules about inlining?

1077


Can you explicitly call a destructor on a local variable?

1028


Can a class be static in c++?

1090


What is a string example?

1069


Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2512


Where Malloc(), Calloc(), and realloc() does get memory?

1049


Differentiate between declaration and definition.

1046


What is the C-style character string?

1146


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

1047


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

2375


What is c++ iterator?

1137


How do you write a function that can reverse a linked-list?

1109


What is #include ctype h in c++?

1165