answersLogoWhite

0

If you want to check whether a string is a palindrome, you can reverse the string (for example, the Java class StringBuffer has a reverse() method), and then compare whether the two strings - the original string and the reverted string - are equal. Alternately, you could write a loop that checks whether the first character of the string is equal to the last one, the second is equal to the second-last one, etc.; that is, you have a counter variable (in a "for" loop) that goes from zero to length - 1 (call it "i"), and compare character #i with character #(length-i-1) inside the loop.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What are the steps to complete the palindrome of 98?

There is 24 steps in the palindrome 98


How many steps does it take to make ninety-eight and eighty-nine a palindrome?

it takes 24 steps to get to a palindrome from the number 89


How do you write a palindrome program in c in Wikipedia?

You don't have to write palindrome programs in wikipedia.


How many steps it is to make 728 a palindrome?

Subtract 1


Write a PHP program to check whether the string is palindrome or not?

You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }


How much steps it takes to find the palindrome of 89?

24 i think


Stack c language program of palindrome?

what ever you assume


What is a palindrome in maths in 2 steps?

12321 is a palindrome number race car is one too they can be the same number or word(s) when written backwards


What is a 2 step palindrome?

19 is a two step palindrome because it takes two steps or two addition sums to make it a palindrome. Step 1 is 19 plus 91 equals 110. Step 2 110 plus 011 is equal to 121 and 121 is a palindrome.


How do you write a program in C to check whether a word is a palindrome or not?

It is a simple program. i think u may understand it :#include#include#includevoid main(){char s[10]=answers.com;char x[10];int a;clrscr();strcpy(x,s);strrev(s);a=strcmp(s,x);if(a==0){printf("the entered string is palindrome");}else{printf("the entered string is not palindrome");}output:given string is not palindrome


What is the explanation for the steps in computer processing?

input and output


How do you write palindrome program in c language?

int pallindrom(int p){ /*write all logic*/ }