Question: Accept a string from user. Check whether it can be a palindrome if we change a single character. If it is so print Can be

  1. Accept a string from user. Check whether it can be a palindrome if we change a single character. If it is so print Can be palindrome and the character need to be changed.
    1. Else print Not possible

  1. Eg : abcdcbg reverse is gbcdcba If you are changing g to a then it became a palindrome

  1. abcdaaa Not possible 2. Accept N numbers from the user, Iterate from start number to the end number and print the sum of the current number and previous number (dont use arrays).Print which pair of values is having the greater sum and print their sum.

Write a code in JAVA to solve the 1 and 2 problems.

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 Databases Questions!