title: Printing two or more strings in vertical form in java
body: <p>Please help me generate a program that will prompt the user to enter 2 strings and display them vertically. The output must be like this: </p>
  
  <pre><code>Enter 1st and 2nd String:
  First
  Second
  
  F  S
  i  e
  r  c
  s  o
  t  n
     d
  </code></pre>
  
  <p>The attempted code:</p>
  
  <pre><code>import java.util.Scanner;
  public class MyCode
  {
  
      public static void main(String[] args) {
          Scanner in = new Scanner(System.in);
          System.out.println("Enter a string");
          String input = in.nextLine();
          String input1=in.nextLine();
          int i =0;
          int j=0;
  
          for(i = 0,j=0; i &lt; input.length()||j&lt;input1.length(); i++,j++) {
              char letter = input.charAt(i);
              char letter1=input1.charAt(j);
              System.out.println(letter + " "+letter1);
          }
      }
  }
  </code></pre>