You are viewing a single comment's thread. Return to all comments →
Scanner sc=new Scanner(System.in); String A=sc.next(); /* Enter your code here. Print output to STDOUT. */ int len =A.length(); String rev="";
for(int i=len-1;i>=0;i--){ rev+=A.charAt(i); } if(rev.equals(A)){ System.out.println("Yes"); }else{ System.out.println("No"); } sc.close();
Seems like cookies are disabled on this browser, please enable them to open this website
Java String Reverse
You are viewing a single comment's thread. Return to all comments →
Scanner sc=new Scanner(System.in); String A=sc.next(); /* Enter your code here. Print output to STDOUT. */ int len =A.length(); String rev="";