Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 769 Bytes

File metadata and controls

45 lines (25 loc) · 769 Bytes

Palindrome

Astrologist believes that having a palindromic name is very auspicious . As we all know, a palindrome is a word that can be read the same way in either direction.There should not be a space or any special character in the word entered. If yes, display "Invalid Input". Write a Java program to determine whether a given word is a palindrome or not.

Sample Input 1:

Enter the word : 
Malayalam

Sample Output 1:

Malayalam is a Palindrome

Sample Input 2:

Enter the word : 
Apple

Sample Output 2:

Apple is not a Palindrome

Sample Input 3:

Enter the word :
no on

Sample Output 3:

Invalid Input

Sample Input 4:

Enter the word :
@nnn

Sample Output 4:

Invalid Input