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

#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,j,f=0;
char a[10];
clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
{
printf("string is not palindrome");
return(0);
}
}

printf("string is palindrome");
return(0);
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

1104


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

1025


Write a code/algo to find the frequency of each element in an array?

1066


What are associate containers?

991


Is c++ an oop?

1047


What parameter does the constructor to an ofstream object take?

1025


What is #include ctype h in c++?

1131


What does new return if there is insufficient memory to make your new object?

994


Explain object slicing in c++?

1030


What is jump statement in C++?

1081


what are Access specifiers in C++ class? What are the types?

1171


Explain about Garbage Collector?

1075


Difference between Abstraction and encapsulation in C++?

1094


What is #include c++?

1067


Why c++ is created?

966