title: Given a A string , print Yes if it is a palindrome, print No otherwise
body: <p>I want to check if the user input is a palindrome or not. But this is not working as expected. Please help.</p>
  
  <p>The code I tried:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class Solution {
  
      public static void main(String[] args) {
          Scanner sc=new Scanner(System.in);
          String A=sc.next();
          for (int i=0; i&lt;A.length()/2; i++){
              if(A.charAt(i)==A.charAt(A.length()-i-1)) {
                  System.out.println("Yes");
              } else {
                  System.out.println("No");
              }
          }
      }
  }
  </code></pre>