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 for 33 to become a palindrome?

To determine how many steps it takes for the number 33 to become a palindrome, we first note that 33 is already a palindrome since it reads the same forwards and backwards. Therefore, it requires 0 steps to become a palindrome.


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.


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 many steps it is to make 728 a palindrome?

Subtract 1


How many steps are there for the palindrome 98?

To determine how many steps it takes to reach a palindrome from the number 98, you reverse the digits and add. Starting with 98, reverse it to get 89, then add: 98 + 89 = 187. Repeat this process: reverse 187 to get 781, then add: 187 + 781 = 968. Reverse 968 to get 869, then add: 968 + 869 = 1837. Continue until you reach a palindrome. The total steps taken to reach a palindrome from 98 is 8, resulting in the palindrome 4884.


Stack c language program of palindrome?

what ever you assume


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

24 i think


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 many steps are required to convert 449 into a palindrome using the reverse and add method?

To convert the number 449 into a palindrome using the reverse and add method, you would follow these steps: First, reverse 449 to get 944, then add the two numbers together (449 + 944 = 1393). Next, reverse 1393 to get 3931 and add them (1393 + 3931 = 5324). Finally, reverse 5324 to get 4235 and add them (5324 + 4235 = 9559), which is a palindrome. Thus, it takes a total of 3 steps to reach the palindrome 9559.