Question: A word that reads the same backward as forward is called a palindrome , e . g . , mom, dad, racecar, madam, and Radar

A word that reads the same backward as forward is called apalindrome, e.g., "mom", "dad", "racecar", "madam", and "Radar" (case-insensitive). Write a program calledTestPalindromicWord, that prompts user for a word and prints ""xxx" is|is not a palindrome".
Note:
1. Maintain two indexes,forwardIndex(fIdx) andbackwardIndex(bIdx), to scan the phrase forward and backward.
2. int fIdx =0, bIdx = strLen -1;
3. while (fIdx < bIdx){
4.......
5.++fIdx;
6.--bIdx;
7.}
8.// or
9. for (int fIdx =0, bIdx = strLen -1; fIdx < bIdx; ++fIdx, --bIdx){
10.......
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!