CODING:
import java.lang.*;
import java.util.Scanner;
class Palin{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
System.out.print("Enter your name:");
StringBuffer nam=new StringBuffer(s.next());
if(nam.toString().equals(nam.reverse().toString()))
System.out.print("String is Palindrom.");
else
System.out.print("String is Not palindrom.");
}
}
import java.util.Scanner;
class Palin{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
System.out.print("Enter your name:");
StringBuffer nam=new StringBuffer(s.next());
if(nam.toString().equals(nam.reverse().toString()))
System.out.print("String is Palindrom.");
else
System.out.print("String is Not palindrom.");
}
}
Comments
Post a Comment