Ans.: The user will input a string and we need to print “Palindrome” or “Not Palindrome” based on whether the input string is a palindrome or not.
- input: madam, output: Palindrome
- input: step on no pets, output: Palindrome
- input: book, output: Not Palindrome
if we pass an integer as string parameter then also this method will give the correct output
- input: 1221, output: Palindrome
No comments:
Post a Comment