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

char a[20],b[20];
printf("enter a string");
scanf("%s",&a);
strcpy(b,a);//copies string a to b
strrev(b);//reverses string b
if(strcmp(a,b)==0)//compares if the original and reverse
strings are same
printf("\n%s is a palindrome",a);
else
printf("\n%s is not a palindrome",a);
return 0;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lvalue?

1131


Is string data type in c++?

977


Should I learn c or c++ or c#?

954


What are virtual functions in c++?

1123


What is the difference between cin.read() and cin.getline()?

1017


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

1200


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

1056


Where can I run c++ program?

1009


Can create new c++ operators?

967


Define a nested class. Explain how it can be useful.

1042


Tell me what are static member functions?

1038


Should a constructor be public or private?

981


Explain what happens when a pointer is deleted twice?

1195


What are static type checking?

1012


What is the main function c++?

1070