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

What is the best c++ book?

1268


What is a catch statement?

1054


Why is c++ considered difficult?

1153


the maximum length of a character constant can be a) 2 b) 1 c) 8

1098


When does a name clash occur in c++?

1173


What are the important differences between c++ and java?

1157


Explain the volatile and mutable keywords.

1072


How is new() different from malloc()?

1136


Is c++ high level programming language?

1142


In a function declaration what does extern means?

1056


Should the this pointer can be used in the constructor?

1030


What is the difference between object-oriented programming and procedural programming?

1239


What is function overriding in c++?

1072


What is the use of endl in c++?

1023


What is the best way to declare and define global variables?

1335