title: Trying to multiply two numbers together using only addition
body: <p>so I'm trying to make a very simple program but I think I am over thinking it. I want to multiply two numbers together without using multiplication, only addition. I know I will have to add X to itself Y times in order to achieve this, but the way my for-loop is now, it simply adds X to itself once and never again. I know that this algorithm is in the wrong place, but I am unsure where else to put it or what else to do. Any help would be appreciated!</p>
  
  <pre><code>import java.util.Scanner;
  
  
  public class multiply {
  
  public static void main(String[] args) {
  
      int x = 0;
      int y = 0;
      int answer = 0;
  
      Scanner scan = new Scanner (System.in);
  
      System.out.println("Please enter a value for x");
      x = scan.nextInt();
  
      System.out.println("Please enter a value for y");
      y = scan.nextInt();
  
      for(int i = 0; i &lt; y; i++){
          answer = x+x;
  
      }
  
      System.out.println(x + " multiplied by " + y + " equals " + answer);
  
  }
  
  }
  </code></pre>